commit | 7a89f15fed1e032052d6b315d9b042e1100540ce | [log] [tgz] |
---|---|---|
author | Xiaozhen Lin <xiaozhenl@google.com> | Fri Apr 07 00:53:30 2023 +0000 |
committer | Xiaozhen Lin <xiaozhenl@google.com> | Thu Apr 13 17:29:48 2023 +0000 |
tree | 0d44a811c806392dba54cceb4e2eca4f58423358 | |
parent | bfb5780a192475a3bae8347101e1ab4c113017d5 [diff] |
Destroy activity in onStop() Pixel Imprint will call onDestroy() whenever its menu is invisible. (https://source.corp.google.com/tm-dev/packages/apps/Settings/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java;l=547?sq=package:tm-dev) 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 Test: manual Change-Id: Idc0c115fc2061d863f9cab2aed99c04340b827f8
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java index 3186a56..398e4b0 100644 --- a/src/com/android/settings/password/ChooseLockGeneric.java +++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -816,6 +816,14 @@ } @Override + public void onStop() { + super.onStop(); + if (!getActivity().isChangingConfigurations() && !mWaitingForConfirmation) { + getActivity().finish(); + } + } + + @Override public void onDestroy() { super.onDestroy(); if (mUserPassword != null) {