Call finish() when enrollment loses focus

Bug: 134971919

Test: Entering keyguard on any enrollment screen finishes enrollment now
Test: Going back/forward works

Change-Id: I2c80a5586c10fa3feb780a5eadfe203abed52dea
This commit is contained in:
Kevin Chyn
2019-06-11 20:40:30 -07:00
parent a854373bee
commit e9d50cd91b
3 changed files with 31 additions and 0 deletions

View File

@@ -47,6 +47,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
private boolean mHasPassword;
private boolean mBiometricUnlockDisabledByAdmin;
private TextView mErrorText;
protected boolean mConfirmingCredentials;
protected boolean mNextClicked;
/**
* @return true if the biometric is disabled by a device administrator
@@ -149,10 +151,12 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
if (!mHasPassword) {
// No password registered, launch into enrollment wizard.
mConfirmingCredentials = true;
launchChooseLock();
} else if (mToken == null) {
// It's possible to have a token but mLaunchedConfirmLock == false, since
// ChooseLockGeneric can pass us a token.
mConfirmingCredentials = true;
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
}
}
@@ -182,6 +186,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
@Override
protected void onNextButtonClick(View view) {
mNextClicked = true;
if (checkMaxEnrolled() == 0) {
// Lock thingy is already set up, launch directly to the next page
launchNextEnrollingActivity(mToken);
@@ -249,12 +254,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
mToken = data.getByteArrayExtra(
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
mConfirmingCredentials = false;
return;
} else {
setResult(resultCode, data);
finish();
}
} else if (requestCode == CONFIRM_REQUEST) {
mConfirmingCredentials = false;
if (resultCode == RESULT_OK && data != null) {
mToken = data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);