Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5fa4d0e authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Add fields to SensorProperties

These will eventually come from the update HIDL interface

Bug: 164225738

Test: Builds
Change-Id: I041db93f8be46e24cf2de94e73b2994d3b95ab8d
parent efa54e47
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -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 =
@@ -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);
    }
}
+8 −3
Original line number Diff line number Diff line
@@ -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>
@@ -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>

+1 −0
Original line number Diff line number Diff line
@@ -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 -->
+1 −1
Original line number Diff line number Diff line
@@ -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);
+5 −1
Original line number Diff line number Diff line
@@ -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 */);