diff options
| author | Abhinay Reddy Vanipally <avanip@codeaurora.org> | 2014-06-13 16:55:42 +0530 |
|---|---|---|
| committer | LorDClockaN <davor@losinj.com> | 2014-08-27 22:26:32 +0200 |
| commit | ddb52f4ae2556977e8587ca9ca465b915f44d3c8 (patch) | |
| tree | 5f9b40bd4346b37cb3efa4de9f4f6f5cb6ecde7b | |
| parent | 36da4a82e0eaf5b81c1e86893c50fef108ffb29a (diff) | |
Exchange: Sync code from tag "android-4.4.3_r1".
CRs-fixed: 680017
Change-Id: I3530db4d0347546ee4ab5d9ec031af8ebfdea639
| -rw-r--r-- | src/com/android/exchange/service/EmailSyncAdapterService.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/exchange/service/EmailSyncAdapterService.java b/src/com/android/exchange/service/EmailSyncAdapterService.java index 3dac3e2a..dac26d7d 100644 --- a/src/com/android/exchange/service/EmailSyncAdapterService.java +++ b/src/com/android/exchange/service/EmailSyncAdapterService.java @@ -781,6 +781,31 @@ public class EmailSyncAdapterService extends AbstractSyncAdapterService { if (operationResult < 0) { break; + } + } + } else if (!accountOnly && !pushOnly) { + // We have to sync multiple folders. + final Cursor c; + if (isFullSync) { + // Full account sync includes all mailboxes that participate in system sync. + c = Mailbox.getMailboxIdsForSync(cr, account.mId); + } else { + // Type-filtered sync should only get the mailboxes of a specific type. + c = Mailbox.getMailboxIdsForSyncByType(cr, account.mId, mailboxType); + } + if (c != null) { + try { + final HashSet<String> authsToSync = getAuthsToSync(acct); + while (c.moveToNext()) { + operationResult = syncMailbox(context, cr, acct, account, + c.getLong(0), extras, syncResult, authsToSync, false); + if (operationResult < 0) { + break; + } + } + } finally { + c.close(); + } } } else if (!accountOnly && !pushOnly) { |
