@Test public void shouldSyncDownLatestProductList() throws Exception { syncAdapter.onPerformSync(null, null, null, null, null); verify(mockSyncDownManager).syncDownServerData(); }
@Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { User user = UserInfoMgr.getInstance().getUser(); if (user == null) { Log.d(TAG, "No user login, skip sync...."); return; } Log.d(TAG, "===> Syncing Data to server"); if (shouldCorrectData(extras)) { List<StockCard> deleteStockCards = dirtyDataManager.correctData(); if (!CollectionUtils.isEmpty(deleteStockCards)) { sendDeletedProductBroadcast(); } } upgradeManager.triggerUpgrade(); triggerSync(); }
SyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { User user = UserInfoMgr.getInstance().getUser(); if (user == null) { Log.d(TAG, "No user login, skip sync...."); return; } Log.d(TAG, "===> Syncing Data to server"); if (shouldCorrectData(extras)) { List<StockCard> deleteStockCards = dirtyDataManager.correctData(); if (!CollectionUtils.isEmpty(deleteStockCards)) { sendDeletedProductBroadcast(); } } upgradeManager.triggerUpgrade(); triggerSync(); } }
SyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { User user = UserInfoMgr.getInstance().getUser(); if (user == null) { Log.d(TAG, "No user login, skip sync...."); return; } Log.d(TAG, "===> Syncing Data to server"); if (shouldCorrectData(extras)) { List<StockCard> deleteStockCards = dirtyDataManager.correctData(); if (!CollectionUtils.isEmpty(deleteStockCards)) { sendDeletedProductBroadcast(); } } upgradeManager.triggerUpgrade(); triggerSync(); } SyncAdapter(Context context, boolean autoInitialize); }
SyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { User user = UserInfoMgr.getInstance().getUser(); if (user == null) { Log.d(TAG, "No user login, skip sync...."); return; } Log.d(TAG, "===> Syncing Data to server"); if (shouldCorrectData(extras)) { List<StockCard> deleteStockCards = dirtyDataManager.correctData(); if (!CollectionUtils.isEmpty(deleteStockCards)) { sendDeletedProductBroadcast(); } } upgradeManager.triggerUpgrade(); triggerSync(); } SyncAdapter(Context context, boolean autoInitialize); @Override void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult); }
SyncAdapter extends AbstractThreadedSyncAdapter { @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { User user = UserInfoMgr.getInstance().getUser(); if (user == null) { Log.d(TAG, "No user login, skip sync...."); return; } Log.d(TAG, "===> Syncing Data to server"); if (shouldCorrectData(extras)) { List<StockCard> deleteStockCards = dirtyDataManager.correctData(); if (!CollectionUtils.isEmpty(deleteStockCards)) { sendDeletedProductBroadcast(); } } upgradeManager.triggerUpgrade(); triggerSync(); } SyncAdapter(Context context, boolean autoInitialize); @Override void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult);  }