|
|
@ -213,7 +213,7 @@ public abstract class SynchronizationProvider {
|
|
|
|
* @param remoteTasks remote tasks that have been updated
|
|
|
|
* @param remoteTasks remote tasks that have been updated
|
|
|
|
* @return local tasks that need to be pushed across
|
|
|
|
* @return local tasks that need to be pushed across
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected void synchronizeTasks(final Context context, LinkedList<TaskProxy>
|
|
|
|
protected synchronized void synchronizeTasks(final Context context, LinkedList<TaskProxy>
|
|
|
|
remoteTasks, SynchronizeHelper helper) throws IOException {
|
|
|
|
remoteTasks, SynchronizeHelper helper) throws IOException {
|
|
|
|
final SyncStats stats = new SyncStats();
|
|
|
|
final SyncStats stats = new SyncStats();
|
|
|
|
final StringBuilder log = new StringBuilder();
|
|
|
|
final StringBuilder log = new StringBuilder();
|
|
|
@ -284,6 +284,7 @@ public abstract class SynchronizationProvider {
|
|
|
|
|
|
|
|
|
|
|
|
// 3. UPDATE: for each updated local task
|
|
|
|
// 3. UPDATE: for each updated local task
|
|
|
|
for(SyncMapping mapping : data.localChanges) {
|
|
|
|
for(SyncMapping mapping : data.localChanges) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
TaskProxy localTask = new TaskProxy(getId(), mapping.getRemoteId());
|
|
|
|
TaskProxy localTask = new TaskProxy(getId(), mapping.getRemoteId());
|
|
|
|
TaskModelForSync task = taskController.fetchTaskForSync(
|
|
|
|
TaskModelForSync task = taskController.fetchTaskForSync(
|
|
|
|
mapping.getTask());
|
|
|
|
mapping.getTask());
|
|
|
@ -294,9 +295,13 @@ public abstract class SynchronizationProvider {
|
|
|
|
localTask.readFromTaskModel(task);
|
|
|
|
localTask.readFromTaskModel(task);
|
|
|
|
localTask.readTagsFromController(task.getTaskIdentifier(),
|
|
|
|
localTask.readTagsFromController(task.getTaskIdentifier(),
|
|
|
|
tagController, data.tags);
|
|
|
|
tagController, data.tags);
|
|
|
|
|
|
|
|
|
|
|
|
postUpdate(new ProgressLabelUpdater(context, R.string.sync_progress_localtx,
|
|
|
|
postUpdate(new ProgressLabelUpdater(context, R.string.sync_progress_localtx,
|
|
|
|
task.getName()));
|
|
|
|
task.getName()));
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
AstridUtilities.reportFlurryError("sync-read-local-task", e);
|
|
|
|
|
|
|
|
Log.e("astrid", "Exception receiving task", e);
|
|
|
|
|
|
|
|
log.append("error reading local task\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
postUpdate(new ProgressUpdater(stats.remoteUpdatedTasks,
|
|
|
|
postUpdate(new ProgressUpdater(stats.remoteUpdatedTasks,
|
|
|
|
data.localChanges.size()));
|
|
|
|
data.localChanges.size()));
|
|
|
|
|
|
|
|
|
|
|
|