am 05b0bb56: Release held mailboxes after policy refresh

Merge commit '05b0bb56254d9ed924dff4c09ad227eec611a695' into gingerbread

* commit '05b0bb56254d9ed924dff4c09ad227eec611a695':
  Release held mailboxes after policy refresh
This commit is contained in:
Marc Blank 2010-07-28 18:31:22 -07:00 committed by Android Git Automerger
commit 4f12c25ed9
2 changed files with 14 additions and 0 deletions

View File

@ -1291,6 +1291,8 @@ public class EasSyncService extends AbstractSyncService {
if (policyKey != null) {
// Write the final policy key to the Account and say we've been successful
ps.writeAccount(mAccount, policyKey, true, mContext);
// Release any mailboxes that might be in a security hold
SyncManager.releaseSecurityHold(mAccount);
return true;
}
} else {

View File

@ -895,6 +895,18 @@ public class SyncManager extends Service implements Runnable {
}
}
/**
* Release security holds for the specified account
* @param account the account whose Mailboxes should be released from security hold
*/
static public void releaseSecurityHold(Account account) {
SyncManager syncManager = INSTANCE;
if (syncManager != null) {
syncManager.releaseSyncHolds(INSTANCE, AbstractSyncService.EXIT_SECURITY_FAILURE,
account);
}
}
/**
* Release a specific type of hold (the reason) for the specified Account; if the account
* is null, mailboxes from all accounts with the specified hold will be released