Allow user without a password to clear credentials
Currently the code assumes that the user always has a pin or password or pattern. If there's no password confirmKeyGuard() will return false, so the acttivity will finish without doing anything. With this change if there's no PIN/password/pattern, the credential clearing task will be launched straightaway as the user presses "OK" the confirmation prompt. Bug: 127697771 Test: manual Change-Id: Iac4af0abfc7430ed197e04f833bf203c3f66f52e
This commit is contained in:
@@ -242,14 +242,20 @@ public final class CredentialStorage extends FragmentActivity {
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
if (mResetConfirmed) {
|
||||
mResetConfirmed = false;
|
||||
if (confirmKeyGuard(CONFIRM_CLEAR_SYSTEM_CREDENTIAL_REQUEST)) {
|
||||
// will return password value via onActivityResult
|
||||
return;
|
||||
}
|
||||
if (!mResetConfirmed) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
finish();
|
||||
|
||||
mResetConfirmed = false;
|
||||
if (!mUtils.isSecure(UserHandle.myUserId())) {
|
||||
// This task will call finish() in the end.
|
||||
new ResetKeyStoreAndKeyChain().execute();
|
||||
} else if (!confirmKeyGuard(CONFIRM_CLEAR_SYSTEM_CREDENTIAL_REQUEST)) {
|
||||
Log.w(TAG, "Failed to launch credential confirmation for a secure user.");
|
||||
finish();
|
||||
}
|
||||
// Confirmation result will be handled in onActivityResult if needed.
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user