Merge "Add biometric enrollment support for private profile" into main

This commit is contained in:
Joseph Vincent
2024-01-16 23:06:37 +00:00
committed by Android (Google) Code Review

View File

@@ -203,6 +203,7 @@ public class ChooseLockGeneric extends SettingsActivity {
private boolean mOnlyEnforceDevicePasswordRequirement = false; private boolean mOnlyEnforceDevicePasswordRequirement = false;
private int mExtraLockScreenTitleResId; private int mExtraLockScreenTitleResId;
private int mExtraLockScreenDescriptionResId; private int mExtraLockScreenDescriptionResId;
private boolean mWaitingForBiometricEnrollment = false;
@Override @Override
public int getMetricsCategory() { public int getMetricsCategory() {
@@ -250,6 +251,7 @@ public class ChooseLockGeneric extends SettingsActivity {
ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE, false); ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE, false);
mForBiometrics = intent.getBooleanExtra( mForBiometrics = intent.getBooleanExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, false); ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, false);
mWaitingForBiometricEnrollment = mForBiometrics || mForFingerprint || mForFace;
mExtraLockScreenTitleResId = intent.getIntExtra(EXTRA_KEY_CHOOSE_LOCK_SCREEN_TITLE, -1); mExtraLockScreenTitleResId = intent.getIntExtra(EXTRA_KEY_CHOOSE_LOCK_SCREEN_TITLE, -1);
mExtraLockScreenDescriptionResId = mExtraLockScreenDescriptionResId =
@@ -440,6 +442,7 @@ public class ChooseLockGeneric extends SettingsActivity {
return true; return true;
} else if (KEY_SKIP_FINGERPRINT.equals(key) || KEY_SKIP_FACE.equals(key) } else if (KEY_SKIP_FINGERPRINT.equals(key) || KEY_SKIP_FACE.equals(key)
|| KEY_SKIP_BIOMETRICS.equals(key)) { || KEY_SKIP_BIOMETRICS.equals(key)) {
mWaitingForBiometricEnrollment = false;
Intent chooseLockGenericIntent = new Intent(getActivity(), Intent chooseLockGenericIntent = new Intent(getActivity(),
getInternalActivityClass()); getInternalActivityClass());
chooseLockGenericIntent.setAction(getIntent().getAction()); chooseLockGenericIntent.setAction(getIntent().getAction());
@@ -493,6 +496,7 @@ public class ChooseLockGeneric extends SettingsActivity {
finish(); finish();
} else if (requestCode == CHOOSE_LOCK_BEFORE_BIOMETRIC_REQUEST } else if (requestCode == CHOOSE_LOCK_BEFORE_BIOMETRIC_REQUEST
&& resultCode == BiometricEnrollBase.RESULT_FINISHED) { && resultCode == BiometricEnrollBase.RESULT_FINISHED) {
mWaitingForBiometricEnrollment = false;
Intent intent = getBiometricEnrollIntent(getActivity()); Intent intent = getBiometricEnrollIntent(getActivity());
if (data != null) { if (data != null) {
// ChooseLockGeneric should have requested for a Gatekeeper Password Handle to // ChooseLockGeneric should have requested for a Gatekeeper Password Handle to
@@ -873,7 +877,8 @@ public class ChooseLockGeneric extends SettingsActivity {
// Otherwise, bugs would be caused. (e.g. b/278488549, b/278530059) // Otherwise, bugs would be caused. (e.g. b/278488549, b/278530059)
final boolean hasCredential = mLockPatternUtils.isSecure(mUserId); final boolean hasCredential = mLockPatternUtils.isSecure(mUserId);
if (!getActivity().isChangingConfigurations() if (!getActivity().isChangingConfigurations()
&& !mWaitingForConfirmation && !mWaitingForActivityResult && hasCredential) { && !mWaitingForConfirmation && !mWaitingForActivityResult && hasCredential
&& !mWaitingForBiometricEnrollment) {
getActivity().finish(); getActivity().finish();
} }
} }