Update multi biometric flow for SUW
Currently, if a user has completed a fingerprint/face enrollment in SUW and they press the back button, we show the UI for each, and it fails with no error. This change makes it so that if a user completes 1 fingerprint or 1 face enrollment, it will no longer try and enroll them again if they have failed. Test: Manual Bug: 191073296 Change-Id: I020c423b5d34797cd7c8be66a2e24051135c9be0
This commit is contained in:
@@ -258,21 +258,6 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
||||
}
|
||||
|
||||
private void setupForMultiBiometricEnroll() {
|
||||
final FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
|
||||
final FaceManager faceManager = getSystemService(FaceManager.class);
|
||||
final List<FingerprintSensorPropertiesInternal> fpProperties =
|
||||
fingerprintManager.getSensorPropertiesInternal();
|
||||
final List<FaceSensorPropertiesInternal> faceProperties =
|
||||
faceManager.getSensorPropertiesInternal();
|
||||
|
||||
// This would need to be updated for devices with multiple sensors of the same modality
|
||||
mIsFaceEnrollable = !faceProperties.isEmpty() &&
|
||||
faceManager.getEnrolledFaces(mUserId).size()
|
||||
< faceProperties.get(0).maxEnrollmentsPerUser;
|
||||
mIsFingerprintEnrollable = !fpProperties.isEmpty() &&
|
||||
fingerprintManager.getEnrolledFingerprints(mUserId).size()
|
||||
< fpProperties.get(0).maxEnrollmentsPerUser;
|
||||
|
||||
if (!mConfirmingCredentials) {
|
||||
mConfirmingCredentials = true;
|
||||
if (!userHasPassword(mUserId)) {
|
||||
@@ -284,7 +269,33 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
||||
}
|
||||
|
||||
private void startMultiBiometricEnroll(Intent data) {
|
||||
final boolean isSetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
|
||||
final FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
|
||||
final FaceManager faceManager = getSystemService(FaceManager.class);
|
||||
final List<FingerprintSensorPropertiesInternal> fpProperties =
|
||||
fingerprintManager.getSensorPropertiesInternal();
|
||||
final List<FaceSensorPropertiesInternal> faceProperties =
|
||||
faceManager.getSensorPropertiesInternal();
|
||||
|
||||
mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(data);
|
||||
|
||||
if (isSetupWizard) {
|
||||
// This would need to be updated for devices with multiple sensors of the same modality
|
||||
mIsFaceEnrollable = !faceProperties.isEmpty()
|
||||
&& faceManager.getEnrolledFaces(mUserId).size() == 0;
|
||||
mIsFingerprintEnrollable = !fpProperties.isEmpty()
|
||||
&& fingerprintManager.getEnrolledFingerprints(mUserId).size() == 0;
|
||||
} else {
|
||||
// This would need to be updated for devices with multiple sensors of the same modality
|
||||
mIsFaceEnrollable = !faceProperties.isEmpty()
|
||||
&& faceManager.getEnrolledFaces(mUserId).size()
|
||||
< faceProperties.get(0).maxEnrollmentsPerUser;
|
||||
mIsFingerprintEnrollable = !fpProperties.isEmpty()
|
||||
&& fingerprintManager.getEnrolledFingerprints(mUserId).size()
|
||||
< fpProperties.get(0).maxEnrollmentsPerUser;
|
||||
|
||||
}
|
||||
|
||||
mMultiBiometricEnrollHelper = new MultiBiometricEnrollHelper(this, mUserId,
|
||||
mIsFaceEnrollable, mIsFingerprintEnrollable, mGkPwHandle);
|
||||
mMultiBiometricEnrollHelper.startNextStep();
|
||||
|
Reference in New Issue
Block a user