Save mConfirmingCredentials state
Fixes: 162486392 Test: Remove all fingerprints/credentials, tap fingerprint settings, rotate device when setting credential. Finish credential setup and biometric enrollment. Only prompted to set up credential once. Test: 1) Wipe device 2) Proceed to set up credential in SUW, but pause on first credential screen (choose lock) 3) adb shell cmd uimode night yes // triggers activity recreate 4) Proceed with credential/biometric setup Notice not re-prompted for credentials Change-Id: I65fc0265acad98b18b152070b85cc4f71693cc68
This commit is contained in:
@@ -43,6 +43,8 @@ import com.google.android.setupdesign.span.LinkSpan;
|
||||
public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
implements LinkSpan.OnClickListener {
|
||||
|
||||
private static final String KEY_CONFIRMING_CREDENTIALS = "confirming_credentials";
|
||||
|
||||
private UserManager mUserManager;
|
||||
private boolean mHasPassword;
|
||||
private boolean mBiometricUnlockDisabledByAdmin;
|
||||
@@ -127,6 +129,10 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
mConfirmingCredentials = savedInstanceState.getBoolean(KEY_CONFIRMING_CREDENTIALS);
|
||||
}
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent.getStringExtra(WizardManagerHelper.EXTRA_THEME) == null) {
|
||||
// Put the theme in the intent so it gets propagated to other activities in the flow
|
||||
@@ -149,6 +155,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
mUserManager = UserManager.get(this);
|
||||
updatePasswordQuality();
|
||||
|
||||
if (!mConfirmingCredentials) {
|
||||
if (!mHasPassword) {
|
||||
// No password registered, launch into enrollment wizard.
|
||||
mConfirmingCredentials = true;
|
||||
@@ -160,6 +167,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
@@ -178,6 +186,12 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putBoolean(KEY_CONFIRMING_CREDENTIALS, mConfirmingCredentials);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldFinishWhenBackgrounded() {
|
||||
return super.shouldFinishWhenBackgrounded() && !mConfirmingCredentials && !mNextClicked;
|
||||
|
Reference in New Issue
Block a user