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

Merge commit 'a95e40df2f4c6c17e53a438e1229199d823efca6'

* commit 'a95e40df2f4c6c17e53a438e1229199d823efca6':
  Release held mailboxes after policy refresh
This commit is contained in:
Marc Blank 2010-07-28 18:35:40 -07:00 committed by Android Git Automerger
commit 1f1be33191
2 changed files with 14 additions and 0 deletions

View File

@ -1316,6 +1316,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

@ -913,6 +913,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