|
|
|
@ -159,7 +159,7 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
protected void performSync() {
|
|
|
|
protected void performSync() {
|
|
|
|
boolean syncSuccess = false;
|
|
|
|
String syncSuccess = "failed";
|
|
|
|
gtasksPreferenceService.recordSyncStart();
|
|
|
|
gtasksPreferenceService.recordSyncStart();
|
|
|
|
if(Constants.DEBUG)
|
|
|
|
if(Constants.DEBUG)
|
|
|
|
Log.e("gtasks-debug", "- -------- SYNC STARTED");
|
|
|
|
Log.e("gtasks-debug", "- -------- SYNC STARTED");
|
|
|
|
@ -196,14 +196,15 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
|
|
|
|
ContextManager.getContext().sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
|
|
|
|
ContextManager.getContext().sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
|
|
|
|
if(Constants.DEBUG)
|
|
|
|
if(Constants.DEBUG)
|
|
|
|
Log.e("gtasks-debug", "- ------ SYNC FINISHED");
|
|
|
|
Log.e("gtasks-debug", "- ------ SYNC FINISHED");
|
|
|
|
syncSuccess = true;
|
|
|
|
|
|
|
|
|
|
|
|
syncSuccess = getFinalSyncStatus();
|
|
|
|
} catch (IllegalStateException e) {
|
|
|
|
} catch (IllegalStateException e) {
|
|
|
|
// occurs when application was closed
|
|
|
|
// occurs when application was closed
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
handleException("gtasks-sync", e, true); //$NON-NLS-1$
|
|
|
|
handleException("gtasks-sync", e, true); //$NON-NLS-1$
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
StatisticsService.reportEvent(StatisticsConstants.GTASKS_SYNC_FINISHED,
|
|
|
|
StatisticsService.reportEvent(StatisticsConstants.GTASKS_SYNC_FINISHED,
|
|
|
|
"success", Boolean.toString(syncSuccess)); //$NON-NLS-1$
|
|
|
|
"success", syncSuccess); //$NON-NLS-1$
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|