Fix attachments when policies change.
This used to be done in the Exchange code, but it's more appropriate here. Change-Id: Ie2bd5722bda46741d367eef3a2e9d2493c3cc4e3
This commit is contained in:
parent
908fac0b24
commit
940a335bab
|
@ -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))) {
|
||||
|
|
Loading…
Reference in New Issue