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))) {