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

Commit bb54d71a authored by Xiaozhen Lin's avatar Xiaozhen Lin
Browse files

Password clearing in Settings App

Pixel Imprint will call onDestroy() whenever its menu is invisible.
(https://cs.android.com/android/platform/superproject/+/master:packages/apps/Settings/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java;l=639?q=packages%2Fapps%2FSettings%2Fsrc%2Fcom%2Fandroid%2Fsettings%2Fbiometrics%2Ffingerprint%2FFingerprintSettings.java&ss=android)
However, Screen lock should have the same behavior as Pixel Imprint but
it doesn't.
onDestroy() for Screen lock should be called whenever we exit the menu
or the menu becomes invisible. Otherwise, the password may be leaked to
RAM unexpectedly in some situations.

Bug: 233373529
Bug: 278488549
Bug: 278530059
Test: manual
Change-Id: Ib11af7073aa1c49096a66c9f5a462e7caf18df5e
parent eb6de672
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -853,6 +853,19 @@ public class ChooseLockGeneric extends SettingsActivity {
            return intent;
        }

        @Override
        public void onStop() {
            super.onStop();
            // hasCredential checks to see if user chooses a password for screen lock. If the
            // screen lock is None or Swipe, we do not want to call getActivity().finish().
            // Otherwise, bugs would be caused. (e.g. b/278488549, b/278530059)
            final boolean hasCredential = mLockPatternUtils.isSecure(mUserId);
            if (!getActivity().isChangingConfigurations()
                    && !mWaitingForConfirmation && hasCredential) {
                getActivity().finish();
            }
        }

        @Override
        public void onDestroy() {
            super.onDestroy();