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
|
public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||||
implements LinkSpan.OnClickListener {
|
implements LinkSpan.OnClickListener {
|
||||||
|
|
||||||
|
private static final String KEY_CONFIRMING_CREDENTIALS = "confirming_credentials";
|
||||||
|
|
||||||
private UserManager mUserManager;
|
private UserManager mUserManager;
|
||||||
private boolean mHasPassword;
|
private boolean mHasPassword;
|
||||||
private boolean mBiometricUnlockDisabledByAdmin;
|
private boolean mBiometricUnlockDisabledByAdmin;
|
||||||
@@ -127,6 +129,10 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
if (savedInstanceState != null) {
|
||||||
|
mConfirmingCredentials = savedInstanceState.getBoolean(KEY_CONFIRMING_CREDENTIALS);
|
||||||
|
}
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent.getStringExtra(WizardManagerHelper.EXTRA_THEME) == null) {
|
if (intent.getStringExtra(WizardManagerHelper.EXTRA_THEME) == null) {
|
||||||
// Put the theme in the intent so it gets propagated to other activities in the flow
|
// Put the theme in the intent so it gets propagated to other activities in the flow
|
||||||
@@ -149,15 +155,17 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
mUserManager = UserManager.get(this);
|
mUserManager = UserManager.get(this);
|
||||||
updatePasswordQuality();
|
updatePasswordQuality();
|
||||||
|
|
||||||
if (!mHasPassword) {
|
if (!mConfirmingCredentials) {
|
||||||
// No password registered, launch into enrollment wizard.
|
if (!mHasPassword) {
|
||||||
mConfirmingCredentials = true;
|
// No password registered, launch into enrollment wizard.
|
||||||
launchChooseLock();
|
mConfirmingCredentials = true;
|
||||||
} else if (mToken == null) {
|
launchChooseLock();
|
||||||
// It's possible to have a token but mLaunchedConfirmLock == false, since
|
} else if (mToken == null) {
|
||||||
// ChooseLockGeneric can pass us a token.
|
// It's possible to have a token but mLaunchedConfirmLock == false, since
|
||||||
mConfirmingCredentials = true;
|
// ChooseLockGeneric can pass us a token.
|
||||||
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
mConfirmingCredentials = true;
|
||||||
|
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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
|
@Override
|
||||||
protected boolean shouldFinishWhenBackgrounded() {
|
protected boolean shouldFinishWhenBackgrounded() {
|
||||||
return super.shouldFinishWhenBackgrounded() && !mConfirmingCredentials && !mNextClicked;
|
return super.shouldFinishWhenBackgrounded() && !mConfirmingCredentials && !mNextClicked;
|
||||||
|
Reference in New Issue
Block a user