am 3b19278a: Only allow the account mailbox to attempt provisioning

Merge commit '3b19278a24ec6f1062d3c5e38580fe9fb20326cf' into froyo-plus-aosp

* commit '3b19278a24ec6f1062d3c5e38580fe9fb20326cf':
  Only allow the account mailbox to attempt provisioning
This commit is contained in:
Marc Blank 2010-04-11 11:55:37 -07:00 committed by Android Git Automerger
commit 605433f78d

View File

@ -1020,6 +1020,9 @@ public class EasSyncService extends AbstractSyncService {
String key = mAccount.mSecuritySyncKey; String key = mAccount.mSecuritySyncKey;
if (key == null || key.length() == 0) { if (key == null || key.length() == 0) {
return; return;
}
if (Eas.PARSER_LOG) {
userLog("Policy key: " , key);
} }
method.setHeader("X-MS-PolicyKey", key); method.setHeader("X-MS-PolicyKey", key);
} }
@ -1385,7 +1388,10 @@ public class EasSyncService extends AbstractSyncService {
} }
} else if (isProvisionError(code)) { } else if (isProvisionError(code)) {
// If the sync error is a provisioning failure (perhaps the policies changed), // If the sync error is a provisioning failure (perhaps the policies changed),
// let's try the provisining procedure // let's try the provisioning procedure
// Provisioning must only be attempted for the account mailbox - trying to
// provision any other mailbox may result in race conditions and the creation
// of multiple policy keys.
if (!tryProvision()) { if (!tryProvision()) {
// Set the appropriate failure status // Set the appropriate failure status
mExitStatus = EXIT_SECURITY_FAILURE; mExitStatus = EXIT_SECURITY_FAILURE;
@ -1918,10 +1924,7 @@ public class EasSyncService extends AbstractSyncService {
} else { } else {
userLog("Sync response error: ", code); userLog("Sync response error: ", code);
if (isProvisionError(code)) { if (isProvisionError(code)) {
if (!tryProvision()) {
mExitStatus = EXIT_SECURITY_FAILURE; mExitStatus = EXIT_SECURITY_FAILURE;
return;
}
} else if (isAuthError(code)) { } else if (isAuthError(code)) {
mExitStatus = EXIT_LOGIN_FAILURE; mExitStatus = EXIT_LOGIN_FAILURE;
} else { } else {