diff options
author | Martin Hibdon <mhibdon@google.com> | 2014-03-28 13:05:22 -0700 |
---|---|---|
committer | Martin Hibdon <mhibdon@google.com> | 2014-04-01 12:17:34 -0700 |
commit | c0d94a44ea94f88a010db4af0a582b5a15bf4aab (patch) | |
tree | b9c11f345be220bea7a774578449cf9070dc8924 /src/com/android/email/service | |
parent | ca7df3f234b0434caab0ca9149b19bad9955777a (diff) | |
download | android_packages_apps_Email-c0d94a44ea94f88a010db4af0a582b5a15bf4aab.tar.gz android_packages_apps_Email-c0d94a44ea94f88a010db4af0a582b5a15bf4aab.tar.bz2 android_packages_apps_Email-c0d94a44ea94f88a010db4af0a582b5a15bf4aab.zip |
Allow setting of the sync window for IMAP accounts
b/13362667
Really this is just for testing, the only window setting
that has any affect is SYNC_WINDOW_ALL. At some point we
should revisit the imap sync window strategy, right now
we will sync up to the oldest message currently on the
device, which is potentially a large amount of data.
Change-Id: I00dd59bd084e85bdf80f3991062b84fcd6a12362
Diffstat (limited to 'src/com/android/email/service')
-rw-r--r-- | src/com/android/email/service/ImapService.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/email/service/ImapService.java b/src/com/android/email/service/ImapService.java index 526a758ab..521c610da 100644 --- a/src/com/android/email/service/ImapService.java +++ b/src/com/android/email/service/ImapService.java @@ -58,6 +58,7 @@ import com.android.emailcommon.provider.EmailContent.SyncColumns; import com.android.emailcommon.provider.Mailbox; import com.android.emailcommon.service.EmailServiceStatus; import com.android.emailcommon.service.SearchParams; +import com.android.emailcommon.service.SyncWindow; import com.android.emailcommon.utility.AttachmentUtilities; import com.android.mail.providers.UIProvider; import com.android.mail.utils.LogUtils; @@ -379,7 +380,11 @@ public class ImapService extends Service { final boolean fullSync = (uiRefresh || loadMore || timeSinceLastFullSync >= FULL_SYNC_INTERVAL_MILLIS || timeSinceLastFullSync < 0); - if (fullSync) { + if (account.mSyncLookback == SyncWindow.SYNC_WINDOW_ALL) { + // This is really for testing. There is no UI that allows setting the sync window for + // IMAP, but it can be set by sending a special intent to AccountSetupFinal activity. + endDate = 0; + } else if (fullSync) { // Find the oldest message in the local store. We need our time window to include // all messages that are currently present locally. endDate = System.currentTimeMillis() - FULL_SYNC_WINDOW_MILLIS; |