Merge "Save mConfirmingCredentials state"
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,6 +155,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
mUserManager = UserManager.get(this);
|
mUserManager = UserManager.get(this);
|
||||||
updatePasswordQuality();
|
updatePasswordQuality();
|
||||||
|
|
||||||
|
if (!mConfirmingCredentials) {
|
||||||
if (!mHasPassword) {
|
if (!mHasPassword) {
|
||||||
// No password registered, launch into enrollment wizard.
|
// No password registered, launch into enrollment wizard.
|
||||||
mConfirmingCredentials = true;
|
mConfirmingCredentials = true;
|
||||||
@@ -160,6 +167,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
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
|
@Override
|
||||||
protected boolean shouldFinishWhenBackgrounded() {
|
protected boolean shouldFinishWhenBackgrounded() {
|
||||||
return super.shouldFinishWhenBackgrounded() && !mConfirmingCredentials && !mNextClicked;
|
return super.shouldFinishWhenBackgrounded() && !mConfirmingCredentials && !mNextClicked;
|
||||||
|
Reference in New Issue
Block a user