diff options
Diffstat (limited to 'src/com/android/exchange/eas/EasProvision.java')
-rw-r--r-- | src/com/android/exchange/eas/EasProvision.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/exchange/eas/EasProvision.java b/src/com/android/exchange/eas/EasProvision.java index 4ea003d1..145fa08d 100644 --- a/src/com/android/exchange/eas/EasProvision.java +++ b/src/com/android/exchange/eas/EasProvision.java @@ -16,9 +16,11 @@ package com.android.exchange.eas; +import android.content.ContentValues; import android.content.Context; import com.android.emailcommon.provider.Account; +import com.android.emailcommon.provider.EmailContent; import com.android.emailcommon.provider.Policy; import com.android.emailcommon.service.PolicyServiceProxy; import com.android.exchange.Eas; @@ -144,6 +146,18 @@ public class EasProvision extends EasOperation { } /** + * Write the max attachment size that came out of the policy to the Account table in the db. + * Once this value is written, the mapping to Account.Settings.MAX_ATTACHMENT_SIZE was + * added to point to this column in this table. + * @param maxAttachmentSize The max attachment size value that we want to write to the db. + */ + private void storeMaxAttachmentSize(final int maxAttachmentSize) { + final ContentValues values = new ContentValues(1); + values.put(EmailContent.AccountColumns.MAX_ATTACHMENT_SIZE, maxAttachmentSize); + Account.update(mContext, Account.CONTENT_URI, getAccountId(), values); + } + + /** * Get the required policy from the server and enforce it. * @return Whether we succeeded in provisioning this account. */ @@ -162,6 +176,10 @@ public class EasProvision extends EasOperation { return false; } + // Even before the policy is accepted, we can honor this setting since it has nothing + // to do with the device policy manager and is requested by the Exchange server. + storeMaxAttachmentSize(mPolicy.mMaxAttachmentSize); + // Apply the policies (that we support) with the temporary key. mPolicy.mProtocolPoliciesUnsupported = null; PolicyServiceProxy.setAccountPolicy(mContext, accountId, mPolicy, null); |