[Auto Pin Confirmation]: Save the autoPinConfirmOptionSetManually field state

- Save and restore the autoPinConfirmOptionSetManually field during activity restart (because of orientation change)
- This helps to retain the state of the auto confirm unlock checkbox  during an orientation change during set PIN stage.

Bug: 268592440
Test: Manual Test
Test: atest ChooseLockPasswordTest
Change-Id: I48ce9080b6007fb4e3a5ca5013d6c21ed4ba664f
This commit is contained in:
Avinash Vadlamudi
2023-02-28 09:09:31 +00:00
parent e34d95d68e
commit 7da92e9295

View File

@@ -225,6 +225,8 @@ public class ChooseLockPassword extends SettingsActivity {
private static final String KEY_UI_STAGE = "ui_stage";
private static final String KEY_CURRENT_CREDENTIAL = "current_credential";
private static final String FRAGMENT_TAG_SAVE_AND_FINISH = "save_and_finish_worker";
private static final String KEY_IS_AUTO_CONFIRM_CHECK_MANUALLY_CHANGED =
"auto_confirm_option_set_manually";
private static final int MIN_AUTO_PIN_REQUIREMENT_LENGTH = 6;
@@ -578,6 +580,8 @@ public class ChooseLockPassword extends SettingsActivity {
mUiStage = Stage.valueOf(state);
updateStage(mUiStage);
}
mIsAutoPinConfirmOptionSetManually =
savedInstanceState.getBoolean(KEY_IS_AUTO_CONFIRM_CHECK_MANUALLY_CHANGED);
mCurrentCredential = savedInstanceState.getParcelable(KEY_CURRENT_CREDENTIAL);
@@ -660,6 +664,8 @@ public class ChooseLockPassword extends SettingsActivity {
if (mCurrentCredential != null) {
outState.putParcelable(KEY_CURRENT_CREDENTIAL, mCurrentCredential.duplicate());
}
outState.putBoolean(KEY_IS_AUTO_CONFIRM_CHECK_MANUALLY_CHANGED,
mIsAutoPinConfirmOptionSetManually);
}
@Override