am 4f12c25e: am 05b0bb56: Release held mailboxes after policy refresh

Merge commit '4f12c25ed9e0e3c0884da642e1fc3450eb781b98' into gingerbread-plus-aosp

* commit '4f12c25ed9e0e3c0884da642e1fc3450eb781b98':
  Release held mailboxes after policy refresh
This commit is contained in:
Marc Blank 2010-07-28 18:33:07 -07:00 committed by Android Git Automerger
commit a95e40df2f
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