|
|
@ -129,8 +129,7 @@ public class ActFmSyncProvider extends SyncProvider<ActFmTaskContainer> {
|
|
|
|
int serverTime = Preferences.getInt(ActFmPreferenceService.PREF_SERVER_TIME, 0);
|
|
|
|
int serverTime = Preferences.getInt(ActFmPreferenceService.PREF_SERVER_TIME, 0);
|
|
|
|
ArrayList<ActFmTaskContainer> remoteTasks = new ArrayList<ActFmTaskContainer>();
|
|
|
|
ArrayList<ActFmTaskContainer> remoteTasks = new ArrayList<ActFmTaskContainer>();
|
|
|
|
|
|
|
|
|
|
|
|
serverTime = (int)(fetchRemoteTasks(serverTime, remoteTasks) - DateUtilities.now()/1000L);
|
|
|
|
int newServerTime = fetchRemoteTasks(serverTime, remoteTasks);
|
|
|
|
|
|
|
|
|
|
|
|
fetchRemoteTagData(serverTime);
|
|
|
|
fetchRemoteTagData(serverTime);
|
|
|
|
|
|
|
|
|
|
|
|
SyncData<ActFmTaskContainer> syncData = populateSyncData(remoteTasks);
|
|
|
|
SyncData<ActFmTaskContainer> syncData = populateSyncData(remoteTasks);
|
|
|
@ -142,8 +141,7 @@ public class ActFmSyncProvider extends SyncProvider<ActFmTaskContainer> {
|
|
|
|
syncData.localUpdated.close();
|
|
|
|
syncData.localUpdated.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
serverTime += DateUtilities.now()/1000L;
|
|
|
|
Preferences.setInt(ActFmPreferenceService.PREF_SERVER_TIME, newServerTime);
|
|
|
|
Preferences.setInt(ActFmPreferenceService.PREF_SERVER_TIME, serverTime);
|
|
|
|
|
|
|
|
actFmPreferenceService.recordSuccessfulSync();
|
|
|
|
actFmPreferenceService.recordSuccessfulSync();
|
|
|
|
|
|
|
|
|
|
|
|
syncSuccess = true;
|
|
|
|
syncSuccess = true;
|
|
|
@ -165,7 +163,7 @@ public class ActFmSyncProvider extends SyncProvider<ActFmTaskContainer> {
|
|
|
|
* @param serverTime last sync time
|
|
|
|
* @param serverTime last sync time
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void fetchRemoteTagData(int serverTime) throws ActFmServiceException, IOException, JSONException {
|
|
|
|
private void fetchRemoteTagData(int serverTime) throws ActFmServiceException, IOException, JSONException {
|
|
|
|
actFmSyncService.fetchTags();
|
|
|
|
actFmSyncService.fetchTags(serverTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|