Do not trigger full sync on push_only requests.
Bug: 11249423
Change-Id: I1285581bf9208b7ee222013d21e07eb9f8bb56e8
diff --git a/src/com/android/exchange/service/EmailSyncAdapterService.java b/src/com/android/exchange/service/EmailSyncAdapterService.java
index 34cb344..a0c49fc 100644
--- a/src/com/android/exchange/service/EmailSyncAdapterService.java
+++ b/src/com/android/exchange/service/EmailSyncAdapterService.java
@@ -631,12 +631,17 @@
final int mailboxType = extras.getInt(Mailbox.SYNC_EXTRA_MAILBOX_TYPE,
Mailbox.TYPE_NONE);
- // A "full sync" means no specific mailbox or type filter was requested.
- final boolean isFullSync = (mailboxIds == null && mailboxType == Mailbox.TYPE_NONE);
+ // Push only means this sync request should only refresh the ping (either because
+ // settings changed, or we need to restart it for some reason).
+ final boolean pushOnly = Mailbox.isPushOnlyExtras(extras);
+ // Account only means just do a FolderSync.
+ final boolean accountOnly = Mailbox.isAccountOnlyExtras(extras);
+
+ // A "full sync" means that we didn't request a more specific type of sync.
+ final boolean isFullSync = (!pushOnly && !accountOnly && mailboxIds == null &&
+ mailboxType == Mailbox.TYPE_NONE);
// A FolderSync is necessary for full sync, initial sync, and account only sync.
- final boolean accountOnly = Mailbox.isAccountOnlyExtras(extras);
- final boolean pushOnly = Mailbox.isPushOnlyExtras(extras);
final boolean isFolderSync = (isFullSync || isInitialSync || accountOnly);
// If we're just twiddling the push, we do the lightweight thing and bail early.
@@ -675,7 +680,7 @@
syncMailbox(context, cr, acct, account, mailboxId, extras, syncResult, null,
true);
}
- } else if (!accountOnly) {
+ } else if (!accountOnly && !pushOnly) {
// We have to sync multiple folders.
final Cursor c;
if (isFullSync) {