diff --git a/core/java/android/hardware/face/FaceSensorProperties.java b/core/java/android/hardware/face/FaceSensorProperties.java index e3b2fbb6c614c..1015724a485d5 100644 --- a/core/java/android/hardware/face/FaceSensorProperties.java +++ b/core/java/android/hardware/face/FaceSensorProperties.java @@ -25,20 +25,36 @@ import android.os.Parcelable; */ public class FaceSensorProperties implements Parcelable { + /** + * A statically configured ID representing this sensor. Sensor IDs must be unique across all + * biometrics across the device, starting at 0, and in increments of 1. + */ public final int sensorId; + /** + * True if the sensor is able to perform generic face detection, without running the + * matching algorithm, and without affecting the lockout counter. + */ public final boolean supportsFaceDetection; + /** + * True if the sensor is able to provide self illumination in dark scenarios, without support + * from above the HAL. + */ + public final boolean supportsSelfIllumination; /** * Initializes SensorProperties with specified values */ - public FaceSensorProperties(int sensorId, boolean supportsFaceDetection) { + public FaceSensorProperties(int sensorId, boolean supportsFaceDetection, + boolean supportsSelfIllumination) { this.sensorId = sensorId; this.supportsFaceDetection = supportsFaceDetection; + this.supportsSelfIllumination = supportsSelfIllumination; } protected FaceSensorProperties(Parcel in) { sensorId = in.readInt(); supportsFaceDetection = in.readBoolean(); + supportsSelfIllumination = in.readBoolean(); } public static final Creator CREATOR = @@ -63,5 +79,6 @@ public class FaceSensorProperties implements Parcelable { public void writeToParcel(Parcel dest, int flags) { dest.writeInt(sensorId); dest.writeBoolean(supportsFaceDetection); + dest.writeBoolean(supportsSelfIllumination); } } diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 613111d512be4..5f2e4f905b1ce 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -4212,15 +4212,20 @@ + BiometricPrompt. This should be used to hide messages that may be too chatty or messages + that the user can't do much about. Entries are defined in + android.hardware.biometrics.face@1.0 types.hal --> + + true + true diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 781e7cff44703..35ce780d34080 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2514,6 +2514,7 @@ + diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java index a0e5f73b6a4cb..11920233e4037 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java @@ -182,7 +182,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { // IBiometricsFace@1.0 does not support detection, only authentication. when(mFaceSensorProperties.isEmpty()).thenReturn(false); when(mFaceSensorProperties.get(anyInt())).thenReturn(new FaceSensorProperties(0 /* id */, - false /* supportsFaceDetection */)); + false /* supportsFaceDetection */, true /* supportsSelfIllumination */)); when(mFingerprintManager.isHardwareDetected()).thenReturn(true); when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(true); diff --git a/services/core/java/com/android/server/biometrics/sensors/face/Face10.java b/services/core/java/com/android/server/biometrics/sensors/face/Face10.java index 7dd6217016eb8..32bb2db77ddcd 100644 --- a/services/core/java/com/android/server/biometrics/sensors/face/Face10.java +++ b/services/core/java/com/android/server/biometrics/sensors/face/Face10.java @@ -45,6 +45,7 @@ import android.os.UserManager; import android.provider.Settings; import android.util.Slog; +import com.android.internal.R; import com.android.internal.util.FrameworkStatsLog; import com.android.server.biometrics.Utils; import com.android.server.biometrics.sensors.AcquisitionClient; @@ -275,7 +276,10 @@ class Face10 implements IHwBinder.DeathRecipient { Face10(@NonNull Context context, int sensorId, @NonNull LockoutResetDispatcher lockoutResetDispatcher) { - mFaceSensorProperties = new FaceSensorProperties(sensorId, false /* supportsFaceDetect */); + final boolean supportsSelfIllumination = context.getResources() + .getBoolean(R.bool.config_faceAuthSupportsSelfIllumination); + mFaceSensorProperties = new FaceSensorProperties(sensorId, false /* supportsFaceDetect */, + supportsSelfIllumination); mContext = context; mSensorId = sensorId; mScheduler = new BiometricScheduler(TAG, null /* gestureAvailabilityTracker */);