am 038be0fc: am c5ec3d0b: Merge change I2eee4ddc into eclair

Merge commit '038be0fc4d5fe36a4691a1227f9af484f0933d98' into eclair-mr2-plus-aosp

* commit '038be0fc4d5fe36a4691a1227f9af484f0933d98':
  Improved fix for #2189704 (sync loss)
This commit is contained in:
Marc Blank 2009-11-04 14:58:50 -08:00 committed by Android Git Automerger
commit d9aa4aea1e

View File

@ -87,6 +87,7 @@ public abstract class AbstractSyncParser extends Parser {
public boolean parse() throws IOException {
int status;
boolean moreAvailable = false;
boolean newSyncKey = false;
int interval = mMailbox.mSyncInterval;
// If we're not at the top of the xml tree, throw an exception
@ -140,10 +141,8 @@ 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;
}
newSyncKey = true;
}
// 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;
@ -153,6 +152,12 @@ public abstract class AbstractSyncParser extends Parser {
}
}
// If we don't have a new sync key, ignore moreAvailable (or we'll loop)
if (moreAvailable && !newSyncKey) {
userLog("!! SyncKey hasn't changed, setting moreAvailable = false");
moreAvailable = false;
}
// Commit any changes
commit();