am 856e09d7: Properly reset security policy when device admin revoked

Merge commit '856e09d76ab62272e660fd4a08e25637f17319a0' into kraken

* commit '856e09d76ab62272e660fd4a08e25637f17319a0':
  Properly reset security policy when device admin revoked
This commit is contained in:
Andrew Stadler 2010-04-07 09:41:37 -07:00 committed by Android Git Automerger
commit ae9f8aa86c

View File

@ -50,7 +50,6 @@ public class SecurityPolicy {
private ComponentName mAdminName;
private PolicySet mAggregatePolicy;
private boolean mNotificationActive;
private boolean mAdminEnabled;
/* package */ static final PolicySet NO_POLICY_SET =
new PolicySet(0, PolicySet.PASSWORD_MODE_NONE, 0, 0, false);
@ -635,13 +634,11 @@ public class SecurityPolicy {
}
/**
* Internal handler for enabled/disabled transitions. Handles DeviceAdmin.onEnabled and
* and DeviceAdmin.onDisabled.
* Internal handler for enabled->disabled transitions. Resets all security keys
* forcing EAS to resync security state.
*/
/* package */ void onAdminEnabled(boolean isEnabled) {
if (isEnabled && !mAdminEnabled) {
// TODO: transition to enabled state
} else if (!isEnabled && mAdminEnabled) {
if (!isEnabled) {
// transition to disabled state
// Response: clear *all* security state information from the accounts, forcing
// them back to the initial configurations requiring policy administration
@ -651,7 +648,6 @@ public class SecurityPolicy {
mContext.getContentResolver().update(Account.CONTENT_URI, cv, null, null);
updatePolicies(-1);
}
mAdminEnabled = isEnabled;
}
/**