Settings ChooseLockscreen* dismiss in background.

Whenever launching
ChooseLockGeneric/ChooseLockPassword/ChooseLockPassword the activity
will finish itself when it goes into the background. This is to ensure
that a user only has an opporunity to complete this process once the
activity is shown. (It cannot be resumed after a power button press, or
sending the activity to the background)

Test: Verified in Settings that the ChooseLockGeneric,
ChooseLockPassword and the ChooseLockPattern activities now exit if they
are sent to the background.
Test: Same as above but in SUW
Test: m -j40 RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.password.ChooseLockPatternTest
Test: m -j40 RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.password.ChooseLockPasswordTest
Fixes: 287473148

Change-Id: Icc9142ff4672ab3669b2f425ff351b03ce7a223a
This commit is contained in:
Joshua McCloskey
2023-10-24 21:37:10 +00:00
parent f29e758da9
commit 302aa72446
6 changed files with 87 additions and 14 deletions

View File

@@ -219,6 +219,13 @@ public class ChooseLockPassword extends SettingsActivity {
findViewById(R.id.content_parent).setFitsSystemWindows(false);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
@Override
public void onPause() {
super.onPause();
if (!isChangingConfigurations()) {
finish();
}
}
public static class ChooseLockPasswordFragment extends InstrumentedFragment
implements OnEditorActionListener, TextWatcher, SaveAndFinishWorker.Listener {