Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcf6cb6f authored by Pavel Grafov's avatar Pavel Grafov Committed by android-build-merger
Browse files

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

am: 0c6ead9e

Change-Id: Iae5bd1947f29de0f3cff3080b3a3f0fc8cf5c99c
parents a6b87a24 0c6ead9e
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -242,15 +242,21 @@ 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
            if (!mResetConfirmed) {
                finish();
                return;
            }
            }

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

    /**