diff options
author | Yu Ping Hu <yph@google.com> | 2013-08-16 17:46:01 -0700 |
---|---|---|
committer | Yu Ping Hu <yph@google.com> | 2013-08-16 17:46:01 -0700 |
commit | 940a335bab634a849b45f62d711601d57f59aeb1 (patch) | |
tree | 9232888d32f775f8b7ee83372f8859a876ebb27b | |
parent | 908fac0b247deff27fee44297f892afdfbb086a5 (diff) | |
download | android_packages_apps_Email-940a335bab634a849b45f62d711601d57f59aeb1.tar.gz android_packages_apps_Email-940a335bab634a849b45f62d711601d57f59aeb1.tar.bz2 android_packages_apps_Email-940a335bab634a849b45f62d711601d57f59aeb1.zip |
Fix attachments when policies change.
This used to be done in the Exchange code, but it's more
appropriate here.
Change-Id: Ie2bd5722bda46741d367eef3a2e9d2493c3cc4e3
-rw-r--r-- | src/com/android/email/SecurityPolicy.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/email/SecurityPolicy.java b/src/com/android/email/SecurityPolicy.java index 60ecbced9..7b73eb74e 100644 --- a/src/com/android/email/SecurityPolicy.java +++ b/src/com/android/email/SecurityPolicy.java @@ -590,6 +590,15 @@ public class SecurityPolicy { if (account.mPolicyKey > 0) { oldPolicy = Policy.restorePolicyWithId(mContext, account.mPolicyKey); } + + // If attachment policies have changed, fix up any affected attachment records + if (oldPolicy != null && securityKey != null) { + if ((oldPolicy.mDontAllowAttachments != policy.mDontAllowAttachments) || + (oldPolicy.mMaxAttachmentSize != policy.mMaxAttachmentSize)) { + Policy.setAttachmentFlagsForNewPolicy(mContext, account, policy); + } + } + boolean policyChanged = (oldPolicy == null) || !oldPolicy.equals(policy); if (!policyChanged && (TextUtilities.stringOrNullEquals(securityKey, account.mSecuritySyncKey))) { |