Merge "Fixed FaceEnrollIntro crash." into main

This commit is contained in:
Treehugger Robot
2024-05-22 03:21:04 +00:00
committed by Android (Google) Code Review

View File

@@ -170,22 +170,25 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
infoMessageRequireEyes.setText(getInfoMessageRequireEyes()); infoMessageRequireEyes.setText(getInfoMessageRequireEyes());
} }
mFaceManager.addAuthenticatorsRegisteredCallback(
new IFaceAuthenticatorsRegisteredCallback.Stub() {
@Override
public void onAllAuthenticatorsRegistered(
@NonNull List<FaceSensorPropertiesInternal> sensors) {
if (sensors.isEmpty()) {
Log.e(TAG, "No sensors");
return;
}
boolean isFaceStrong = sensors.get(0).sensorStrength if (mFaceManager != null) {
== SensorProperties.STRENGTH_STRONG; mFaceManager.addAuthenticatorsRegisteredCallback(
mIsFaceStrong = isFaceStrong; new IFaceAuthenticatorsRegisteredCallback.Stub() {
onFaceStrengthChanged(); @Override
} public void onAllAuthenticatorsRegistered(
}); @NonNull List<FaceSensorPropertiesInternal> sensors) {
if (sensors.isEmpty()) {
Log.e(TAG, "No sensors");
return;
}
boolean isFaceStrong = sensors.get(0).sensorStrength
== SensorProperties.STRENGTH_STRONG;
mIsFaceStrong = isFaceStrong;
onFaceStrengthChanged();
}
});
}
// This path is an entry point for SetNewPasswordController, e.g. // This path is an entry point for SetNewPasswordController, e.g.
// adb shell am start -a android.app.action.SET_NEW_PASSWORD // adb shell am start -a android.app.action.SET_NEW_PASSWORD