Merge "Allow user without a password to clear credentials" into qt-dev

am: 0c6ead9e61

Change-Id: Iae5bd1947f29de0f3cff3080b3a3f0fc8cf5c99c
This commit is contained in:
Pavel Grafov
2019-04-10 16:49:03 -07:00
committed by android-build-merger

View File

@@ -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.
}
}