From 3c8a42ddd9482ebc8541f7af6f15afdf3b3ec151 Mon Sep 17 00:00:00 2001 From: Matthew Williams Date: Mon, 25 Aug 2014 17:59:52 -0700 Subject: [PATCH] Don't back-off ALREADY_IN_PROGRESS syncs BUG: 16219182 The issue is that some adapters get into a bad state where SyncManager assumes them complete yet they are still going. This result in ALREADY_IN_PROGRESS coming back from the adapter, the default retry-time for which is about 10s. Subject ALREADY_IN_PROGRESS to exponential back-off to avoid waking up SM every ~10 seconds Change-Id: I6cef787366436c678bac762ec6daf6212f04badc --- .../core/java/com/android/server/content/SyncManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java index 949019ed1c41a..7a1b03c76f10a 100644 --- a/services/core/java/com/android/server/content/SyncManager.java +++ b/services/core/java/com/android/server/content/SyncManager.java @@ -2757,9 +2757,7 @@ public class SyncManager { } else { Log.d(TAG, "failed sync operation " + syncOperation + ", " + syncResult); // the operation failed so increase the backoff time - if (!syncResult.syncAlreadyInProgress) { - increaseBackoffSetting(syncOperation); - } + increaseBackoffSetting(syncOperation); // reschedule the sync if so indicated by the syncResult maybeRescheduleSync(syncResult, syncOperation); historyMessage = ContentResolver.syncErrorToString(