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

Commit 5a2f6275 authored by Roman Birg's avatar Roman Birg Committed by Gerrit Code Review
Browse files

Protected apps: fixup rotation states



We need to persist and restore the activity states across rotates so the
user doesn't have to restart from the beginning.

Ref: CYNGNOS-141

Change-Id: I18458d55748666b439cf7b6fcecd81ee5c4c7865
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent f1bf96dc
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -148,6 +148,12 @@ public class LockPatternActivity extends Activity implements OnNotifyAccountRese
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBoolean("isAccountView", mAccountView.getVisibility() == View.VISIBLE);
        outState.putBoolean("continueEnabled", mContinue.isEnabled());
        outState.putBoolean("confirming", mConfirming);
        outState.putBoolean("retrypattern", mRetryPattern);
        outState.putInt("retry", mRetry);
        outState.putByteArray("pattern_hash", mPatternHash);
        outState.putBoolean("create", mCreate);
    }

    @Override
@@ -157,6 +163,13 @@ public class LockPatternActivity extends Activity implements OnNotifyAccountRese
            switchToAccount();
        } else {
            switchToPattern(false);
            mPatternHash = savedInstanceState.getByteArray("pattern_hash");
            mConfirming = savedInstanceState.getBoolean("confirming");
            mRetryPattern = savedInstanceState.getBoolean("retrypattern");
            mRetry = savedInstanceState.getInt("retry");
            mCreate = savedInstanceState.getBoolean("create");
            mContinue.setEnabled(savedInstanceState.getBoolean("continueEnabled",
                    mContinue.isEnabled()));
        }
    }

@@ -220,7 +233,6 @@ public class LockPatternActivity extends Activity implements OnNotifyAccountRese
        resetPatternState(false);

        //Setup Pattern Lock View
        mLockPatternView.setSaveEnabled(false);
        mLockPatternView.setFocusable(false);
        mLockPatternView.setOnPatternListener(new UnlockPatternListener());