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
This commit is contained in:
Xiaozhen Lin
2023-04-07 00:53:30 +00:00
parent bfb5780a19
commit 7a89f15fed

View File

@@ -815,6 +815,14 @@ public class ChooseLockGeneric extends SettingsActivity {
return intent;
}
@Override
public void onStop() {
super.onStop();
if (!getActivity().isChangingConfigurations() && !mWaitingForConfirmation) {
getActivity().finish();
}
}
@Override
public void onDestroy() {
super.onDestroy();