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

Commit 1f0953bf authored by “Grace's avatar “Grace
Browse files

Adds property indicating presence of power button fingerprint sensor

Adds boolean field is_powerbutton_fps indicating whether device has a
power button fingerprint sensor, and adds is_powerbutton_fps to dump sys

Test: adb shell dumpsys fingerprint
Test: adb shell dumpsys biometric

Bug: 183642196
Change-Id: Ib433e6f54a57692be23291a55abba5cea8ed0d9d
parent 07ad9d71
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4434,6 +4434,9 @@
      -->
    </integer-array>

    <!-- Indicates whether device has a power button fingerprint sensor. -->
    <bool name="config_is_powerbutton_fps" translatable="false" >false</bool>

    <!-- Messages that should not be shown to the user during face auth enrollment. 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 -->
+1 −0
Original line number Diff line number Diff line
@@ -2560,6 +2560,7 @@
  <java-symbol type="array" name="config_biometric_sensors" />
  <java-symbol type="bool" name="allow_test_udfps" />
  <java-symbol type="array" name="config_udfps_sensor_props" />
  <java-symbol type="bool" name="config_is_powerbutton_fps" />

  <java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_vendor_enroll_ignorelist" />
+14 −3
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
    private int mCurrentUserId = UserHandle.USER_NULL;
    private final boolean mIsUdfps;
    private final int mSensorId;
    private boolean mIsPowerbuttonFps;

    private final class BiometricTaskStackListener extends TaskStackListener {
        @Override
@@ -345,9 +346,18 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
        mIsUdfps = !ArrayUtils.isEmpty(
                mContext.getResources().getIntArray(R.array.config_udfps_sensor_props));

        final @FingerprintSensorProperties.SensorType int sensorType =
                mIsUdfps ? FingerprintSensorProperties.TYPE_UDFPS_OPTICAL
                        : FingerprintSensorProperties.TYPE_REAR;
        // config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor.
        mIsPowerbuttonFps = mContext.getResources().getBoolean(R.bool.config_is_powerbutton_fps);

        final @FingerprintSensorProperties.SensorType int sensorType;
        if (mIsUdfps) {
            sensorType = FingerprintSensorProperties.TYPE_UDFPS_OPTICAL;
        } else if (mIsPowerbuttonFps) {
            sensorType = FingerprintSensorProperties.TYPE_POWER_BUTTON;
        } else {
            sensorType = FingerprintSensorProperties.TYPE_REAR;
        }

        // IBiometricsFingerprint@2.1 does not manage timeout below the HAL, so the Gatekeeper HAT
        // cannot be checked
        final boolean resetLockoutRequiresHardwareAuthToken = false;
@@ -835,6 +845,7 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
        try {
            dump.put("service", TAG);
            dump.put("isUdfps", mIsUdfps);
            dump.put("isPowerbuttonFps", mIsPowerbuttonFps);

            JSONArray sets = new JSONArray();
            for (UserInfo user : UserManager.get(mContext).getUsers()) {