am 6bd7a167: Fix problem w/ sync of large calendars (never syncs)

Merge commit '6bd7a167249727f4b7d4d4cfe713be421f400e51' into froyo-plus-aosp

* commit '6bd7a167249727f4b7d4d4cfe713be421f400e51':
  Fix problem w/ sync of large calendars (never syncs)
This commit is contained in:
Marc Blank 2010-05-24 22:48:41 -07:00 committed by Android Git Automerger
commit 5c0f3b332f

View File

@ -1982,21 +1982,19 @@ public class EasSyncService extends AbstractSyncService {
.start(Tags.SYNC_COLLECTION)
.data(Tags.SYNC_CLASS, className)
.data(Tags.SYNC_SYNC_KEY, syncKey)
.data(Tags.SYNC_COLLECTION_ID, mailbox.mServerId)
.tag(Tags.SYNC_DELETES_AS_MOVES);
.data(Tags.SYNC_COLLECTION_ID, mailbox.mServerId);
// Start with the default timeout
int timeout = COMMAND_TIMEOUT;
if (!syncKey.equals("0")) {
// EAS doesn't like GetChanges if the syncKey is "0"; not documented
// EAS doesn't allow GetChanges in an initial sync; sending other options
// appears to cause the server to delay its response in some cases, and this delay
// can be long enough to result in an IOException and total failure to sync.
// Therefore, we don't send any options with the initial sync.
s.tag(Tags.SYNC_DELETES_AS_MOVES);
s.tag(Tags.SYNC_GET_CHANGES);
} else {
// Use enormous timeout for initial sync, which empirically can take a while longer
timeout = 120*SECONDS;
}
s.data(Tags.SYNC_WINDOW_SIZE,
className.equals("Email") ? EMAIL_WINDOW_SIZE : PIM_WINDOW_SIZE);
// Handle options
s.start(Tags.SYNC_OPTIONS);
// Set the lookback appropriately (EAS calls this a "filter") for all but Contacts
@ -2018,7 +2016,10 @@ public class EasSyncService extends AbstractSyncService {
s.data(Tags.SYNC_TRUNCATION, Eas.EAS2_5_TRUNCATION_SIZE);
}
s.end();
} else {
// Use enormous timeout for initial sync, which empirically can take a while longer
timeout = 120*SECONDS;
}
// Send our changes up to the server
target.sendLocalChanges(s);