Update account object in Policy#setAccountPolicy
* We weren't updating the account object passed in to setAccountPolicy, which is problematic if the object is cached and used subsequently in the code (it would have stale policy values) Bug: 5245056 Change-Id: I279570dfd66c4a65d751f73e2e56578be186d339
This commit is contained in:
parent
891da84a25
commit
b169192c8a
|
@ -163,7 +163,8 @@ public final class Policy extends EmailContent implements EmailContent.PolicyCol
|
|||
/**
|
||||
* Set the policy for an account atomically; this also removes any other policy associated with
|
||||
* the account and sets the policy key for the account. If policy is null, the policyKey is
|
||||
* set to 0 and the securitySyncKey to null
|
||||
* set to 0 and the securitySyncKey to null. Also, update the account object to reflect the
|
||||
* current policyKey and securitySyncKey
|
||||
* @param context the caller's context
|
||||
* @param account the account whose policy is to be set
|
||||
* @param policy the policy to set, or null if we're clearing the policy
|
||||
|
@ -206,6 +207,7 @@ public final class Policy extends EmailContent implements EmailContent.PolicyCol
|
|||
|
||||
try {
|
||||
context.getContentResolver().applyBatch(EmailContent.AUTHORITY, ops);
|
||||
account.refresh(context);
|
||||
} catch (RemoteException e) {
|
||||
// This is fatal to a remote process
|
||||
throw new IllegalStateException("Exception setting account policy.");
|
||||
|
|
Loading…
Reference in New Issue