Make sure we don't send illegal filter to EAS
* Still investigating the reason that AUTO can get sent (this is
bug 5007809), but at least make sure we work around the issue
Change-Id: Ibb7897749a6be81fc390b2f8e5d3dff12a383c3c
diff --git a/src/com/android/exchange/adapter/EmailSyncAdapter.java b/src/com/android/exchange/adapter/EmailSyncAdapter.java
index 464ce57..cfdc901 100644
--- a/src/com/android/exchange/adapter/EmailSyncAdapter.java
+++ b/src/com/android/exchange/adapter/EmailSyncAdapter.java
@@ -215,6 +215,11 @@
s.data(Tags.SYNC_WINDOW_SIZE, EMAIL_WINDOW_SIZE);
s.start(Tags.SYNC_OPTIONS);
// Set the lookback appropriately (EAS calls this a "filter")
+ String filter = getEmailFilter();
+ // We shouldn't get FILTER_AUTO here, but if we do, make it something legal...
+ if (filter.equals(Eas.FILTER_AUTO)) {
+ filter = Eas.FILTER_3_DAYS;
+ }
s.data(Tags.SYNC_FILTER_TYPE, getEmailFilter());
// Set the truncation amount for all classes
if (protocolVersion >= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE) {