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

Commit 7da92e92 authored by Avinash Vadlamudi's avatar Avinash Vadlamudi
Browse files

[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
parent e34d95d6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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