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:
@@ -47,6 +47,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
private boolean mHasPassword;
|
private boolean mHasPassword;
|
||||||
private boolean mBiometricUnlockDisabledByAdmin;
|
private boolean mBiometricUnlockDisabledByAdmin;
|
||||||
private TextView mErrorText;
|
private TextView mErrorText;
|
||||||
|
protected boolean mConfirmingCredentials;
|
||||||
|
protected boolean mNextClicked;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the biometric is disabled by a device administrator
|
* @return true if the biometric is disabled by a device administrator
|
||||||
@@ -149,10 +151,12 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
|
|
||||||
if (!mHasPassword) {
|
if (!mHasPassword) {
|
||||||
// No password registered, launch into enrollment wizard.
|
// No password registered, launch into enrollment wizard.
|
||||||
|
mConfirmingCredentials = true;
|
||||||
launchChooseLock();
|
launchChooseLock();
|
||||||
} else if (mToken == null) {
|
} else if (mToken == null) {
|
||||||
// It's possible to have a token but mLaunchedConfirmLock == false, since
|
// It's possible to have a token but mLaunchedConfirmLock == false, since
|
||||||
// ChooseLockGeneric can pass us a token.
|
// ChooseLockGeneric can pass us a token.
|
||||||
|
mConfirmingCredentials = true;
|
||||||
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
launchConfirmLock(getConfirmLockTitleResId(), getChallenge());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,6 +186,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNextButtonClick(View view) {
|
protected void onNextButtonClick(View view) {
|
||||||
|
mNextClicked = true;
|
||||||
if (checkMaxEnrolled() == 0) {
|
if (checkMaxEnrolled() == 0) {
|
||||||
// Lock thingy is already set up, launch directly to the next page
|
// Lock thingy is already set up, launch directly to the next page
|
||||||
launchNextEnrollingActivity(mToken);
|
launchNextEnrollingActivity(mToken);
|
||||||
@@ -249,12 +254,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
mToken = data.getByteArrayExtra(
|
mToken = data.getByteArrayExtra(
|
||||||
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
|
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
|
||||||
overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
|
overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
|
||||||
|
mConfirmingCredentials = false;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
setResult(resultCode, data);
|
setResult(resultCode, data);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
} else if (requestCode == CONFIRM_REQUEST) {
|
} else if (requestCode == CONFIRM_REQUEST) {
|
||||||
|
mConfirmingCredentials = false;
|
||||||
if (resultCode == RESULT_OK && data != null) {
|
if (resultCode == RESULT_OK && data != null) {
|
||||||
mToken = data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
|
mToken = data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
|
||||||
overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
|
overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
|
||||||
|
@@ -61,6 +61,7 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
private Intent mResultIntent;
|
private Intent mResultIntent;
|
||||||
private TextView mDescriptionText;
|
private TextView mDescriptionText;
|
||||||
|
private boolean mNextClicked;
|
||||||
|
|
||||||
private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
|
private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
|
||||||
new CompoundButton.OnCheckedChangeListener() {
|
new CompoundButton.OnCheckedChangeListener() {
|
||||||
@@ -184,6 +185,17 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
|
||||||
|
if (!isChangingConfigurations() && !WizardManagerHelper.isAnySetupWizard(getIntent())
|
||||||
|
&& !mNextClicked) {
|
||||||
|
setResult(RESULT_SKIP);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNextButtonClick(View view) {
|
protected void onNextButtonClick(View view) {
|
||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
@@ -193,6 +205,7 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
if (mUserId != UserHandle.USER_NULL) {
|
if (mUserId != UserHandle.USER_NULL) {
|
||||||
intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
|
intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
|
||||||
}
|
}
|
||||||
|
intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
|
||||||
final String flattenedString = getString(R.string.config_face_enroll);
|
final String flattenedString = getString(R.string.config_face_enroll);
|
||||||
if (!TextUtils.isEmpty(flattenedString)) {
|
if (!TextUtils.isEmpty(flattenedString)) {
|
||||||
ComponentName componentName = ComponentName.unflattenFromString(flattenedString);
|
ComponentName componentName = ComponentName.unflattenFromString(flattenedString);
|
||||||
@@ -204,6 +217,7 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
if (mResultIntent != null) {
|
if (mResultIntent != null) {
|
||||||
intent.putExtras(mResultIntent);
|
intent.putExtras(mResultIntent);
|
||||||
}
|
}
|
||||||
|
mNextClicked = true;
|
||||||
WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
|
WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
|
||||||
startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
|
startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
|
||||||
}
|
}
|
||||||
|
@@ -77,6 +77,16 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
|
||||||
|
if (!isChangingConfigurations() && !mConfirmingCredentials && !mNextClicked
|
||||||
|
&& !WizardManagerHelper.isAnySetupWizard(getIntent())) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isDisabledByAdmin() {
|
protected boolean isDisabledByAdmin() {
|
||||||
return RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled(
|
return RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled(
|
||||||
|
Reference in New Issue
Block a user