DO NOT MERGE: Always allow max calendar age policy
* Turns out we never need to reject this policy; the most restrictive
value is the only limit we currently use
* Clean backport from master I072ce9e9d48f5927928995dce94207890ab2a387
Bug: 5790939
Change-Id: I1a938e6786841334b449a92279cf19ea0f60197b
diff --git a/src/com/android/exchange/adapter/ProvisionParser.java b/src/com/android/exchange/adapter/ProvisionParser.java
index 9d912df..bfbb031 100644
--- a/src/com/android/exchange/adapter/ProvisionParser.java
+++ b/src/com/android/exchange/adapter/ProvisionParser.java
@@ -311,23 +311,22 @@
}
}
break;
- // We currently reject these next two policies
+ // We accept calendar age, since we never ask for more than two weeks, and that's
+ // the most restrictive policy
case Tags.PROVISION_MAX_CALENDAR_AGE_FILTER:
+ policy.mMaxCalendarLookback = getValueInt();
+ break;
+ // We currently reject max email age filter (unless it's 0, i.e. none specified)
case Tags.PROVISION_MAX_EMAIL_AGE_FILTER:
max = getValueInt();
+ policy.mMaxEmailLookback = max;
// 0 indicates no specified filter
if (max != 0) {
- if (tag == Tags.PROVISION_MAX_CALENDAR_AGE_FILTER) {
- policy.mMaxCalendarLookback = max;
- unsupportedList.add(R.string.policy_max_calendar_age);
- } else {
- policy.mMaxEmailLookback = max;
- unsupportedList.add(R.string.policy_max_email_age);
- }
+ unsupportedList.add(R.string.policy_max_email_age);
tagIsSupported = false;
}
break;
- // We currently reject these next two policies
+ // We currently reject these next two policies
case Tags.PROVISION_MAX_EMAIL_BODY_TRUNCATION_SIZE:
case Tags.PROVISION_MAX_EMAIL_HTML_BODY_TRUNCATION_SIZE:
String value = getValue();