summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Lee <anthonylee@google.com>2014-03-10 16:32:36 -0700
committerAnthony Lee <anthonylee@google.com>2014-03-10 16:38:06 -0700
commit22f48edfddcd5cd594e62f28444ff2934965d0d3 (patch)
treec01ecc915cbbf79d8dfd7b5674b7b4a4bdfdb4ad
parentc60938ced3be4837f0f9350f614b2eb40a5417f5 (diff)
downloadExchange-22f48edfddcd5cd594e62f28444ff2934965d0d3.tar.gz
b/12723917. Make sure that explicit request to sync from our code
sets manual to true. This solves the problem of sync requests being dropped on the floor if email sync is disabled but something like calendar is still enabled. Change-Id: Ia8584e2f11e5ca46d43e91738986fbb53d465c57
-rw-r--r--src/com/android/exchange/eas/EasOperation.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/exchange/eas/EasOperation.java b/src/com/android/exchange/eas/EasOperation.java
index 97df7667..7a6cc5b1 100644
--- a/src/com/android/exchange/eas/EasOperation.java
+++ b/src/com/android/exchange/eas/EasOperation.java
@@ -696,6 +696,15 @@ public abstract class EasOperation {
protected static void requestSyncForMailboxes(final android.accounts.Account amAccount,
final ArrayList<Long> mailboxIds) {
final Bundle extras = Mailbox.createSyncBundle(mailboxIds);
+ /**
+ * Please note that it is very possible that we are trying to send a request to the
+ * email sync adapter even though email push is turned off (i.e. this account might only
+ * be syncing calendar or contacts). In this situation we need to make sure that
+ * this request is marked as manual as to ensure that the sync manager does not drop it
+ * on the floor. Right now, this function is only called by EasPing, if it is every called
+ * by another caller, then we should reconsider if manual=true is the right thing to do.
+ */
+ extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
ContentResolver.requestSync(amAccount, EmailContent.AUTHORITY, extras);
LogUtils.i(LOG_TAG, "requestSync EasOperation requestSyncForMailboxes %s, %s",
amAccount.toString(), extras.toString());