From 288bb26ab82f1a3d7053affd766d158d5a7c8d9f Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 15 Oct 2009 12:11:39 -0700 Subject: [PATCH] Handle case of moreAvailable true with no changes (#2189704) * An Exchange log from Moto has shown sync behavior in which moreAvailable is set to true even though there are no changes in the sync response (i.e. the SyncKey is unchanged) * This leads to long-lived looping which impacts battery life * The fix is to recognize the behavior and prevent looping by setting moreAvailable = false Change-Id: Idef455f3e1170caf4002542ca432d128b3a19e56 --- src/com/android/exchange/adapter/AbstractSyncParser.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/exchange/adapter/AbstractSyncParser.java b/src/com/android/exchange/adapter/AbstractSyncParser.java index c913af4ad..4c73fd8f3 100644 --- a/src/com/android/exchange/adapter/AbstractSyncParser.java +++ b/src/com/android/exchange/adapter/AbstractSyncParser.java @@ -140,7 +140,10 @@ public abstract class AbstractSyncParser extends Parser { mAdapter.setSyncKey(newKey, true); cv.put(MailboxColumns.SYNC_KEY, newKey); mailboxUpdated = true; - } + } else if (moreAvailable) { + userLog("!! SyncKey hasn't changed, setting moreAvailable = false"); + moreAvailable = false; + } // If we were pushing (i.e. auto-start), now we'll become ping-triggered if (mMailbox.mSyncInterval == Mailbox.CHECK_INTERVAL_PUSH) { mMailbox.mSyncInterval = Mailbox.CHECK_INTERVAL_PING;