Loading core/java/android/hardware/face/FaceSensorProperties.java +18 −1 Original line number Diff line number Diff line Loading @@ -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<FaceSensorProperties> CREATOR = Loading @@ -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); } } core/res/res/values/config.xml +8 −3 Original line number Diff line number Diff line Loading @@ -4212,8 +4212,8 @@ </integer-array> <!-- Messages that should not be shown to the user during face authentication, on 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 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 --> <integer-array name="config_face_acquire_biometricprompt_ignorelist" translatable="false" > </integer-array> Loading @@ -4221,6 +4221,11 @@ <integer-array name="config_face_acquire_vendor_biometricprompt_ignorelist" translatable="false" > </integer-array> <!-- True if the sensor is able to provide self illumination in dark secnarios, without support from above the HAL. This configuration is only applicable to IBiometricsFace@1.0 and its minor revisions. --> <bool name="config_faceAuthSupportsSelfIllumination">true</bool> <!-- If face auth sends the user directly to home/last open app, or stays on keyguard --> <bool name="config_faceAuthDismissesKeyguard">true</bool> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2514,6 +2514,7 @@ <java-symbol type="array" name="config_face_acquire_vendor_keyguard_ignorelist" /> <java-symbol type="array" name="config_face_acquire_biometricprompt_ignorelist" /> <java-symbol type="array" name="config_face_acquire_vendor_biometricprompt_ignorelist" /> <java-symbol type="bool" name="config_faceAuthSupportsSelfIllumination" /> <java-symbol type="bool" name="config_faceAuthDismissesKeyguard" /> <!-- Face config --> Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading services/core/java/com/android/server/biometrics/sensors/face/Face10.java +5 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 */); Loading Loading
core/java/android/hardware/face/FaceSensorProperties.java +18 −1 Original line number Diff line number Diff line Loading @@ -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<FaceSensorProperties> CREATOR = Loading @@ -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); } }
core/res/res/values/config.xml +8 −3 Original line number Diff line number Diff line Loading @@ -4212,8 +4212,8 @@ </integer-array> <!-- Messages that should not be shown to the user during face authentication, on 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 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 --> <integer-array name="config_face_acquire_biometricprompt_ignorelist" translatable="false" > </integer-array> Loading @@ -4221,6 +4221,11 @@ <integer-array name="config_face_acquire_vendor_biometricprompt_ignorelist" translatable="false" > </integer-array> <!-- True if the sensor is able to provide self illumination in dark secnarios, without support from above the HAL. This configuration is only applicable to IBiometricsFace@1.0 and its minor revisions. --> <bool name="config_faceAuthSupportsSelfIllumination">true</bool> <!-- If face auth sends the user directly to home/last open app, or stays on keyguard --> <bool name="config_faceAuthDismissesKeyguard">true</bool> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2514,6 +2514,7 @@ <java-symbol type="array" name="config_face_acquire_vendor_keyguard_ignorelist" /> <java-symbol type="array" name="config_face_acquire_biometricprompt_ignorelist" /> <java-symbol type="array" name="config_face_acquire_vendor_biometricprompt_ignorelist" /> <java-symbol type="bool" name="config_faceAuthSupportsSelfIllumination" /> <java-symbol type="bool" name="config_faceAuthDismissesKeyguard" /> <!-- Face config --> Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading
services/core/java/com/android/server/biometrics/sensors/face/Face10.java +5 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 */); Loading