am c5ec3d0b: Merge change I2eee4ddc into eclair

Merge commit 'c5ec3d0bce03de10c4bb1bc5cf013494c6d62947' into eclair-mr2

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

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,9 +141,7 @@ 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) {
@ -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();