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

Commit bd6ff266 authored by Bruno Martins's avatar Bruno Martins
Browse files

Biometrics: Hook up support for halHandlesDisplayTouches prop

Fingerprint AIDL interface supports boolean type sensor prop
halHandlesDisplayTouches, that defines whether the HAL is responsible
for detecting and processing of display touches [1].

If the value is false, the framework was supposed to be responsible for
handling the display touch events and passing them down to the HAL by
using ISession#onPointerDown and ISession#onPointerUp. If the value is
true, the framework was not supposed to notify the HAL about touch
events.

Currently, Android framework is not aware of this prop, so hook it up
for the expected outcome.

[1] https://cs.android.com/android/platform/superproject/main/+/main:hardware/interfaces/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl?q=halHandlesDisplayTouches

Test: Build and verify no regression authenticating or registering
fingerprints with udfps AIDL HAL.
Change-Id: I56166950c6ef7cbb0c4ac2c0b7998e4a909d4af9
parent 0f22bfd5
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
     */
    public final @FingerprintSensorProperties.SensorType int sensorType;
    public final boolean halControlsIllumination;
    public final boolean halHandlesDisplayTouches;

    private final List<SensorLocationInternal> mSensorLocations;

@@ -48,6 +49,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
            @NonNull List<ComponentInfoInternal> componentInfo,
            @FingerprintSensorProperties.SensorType int sensorType,
            boolean halControlsIllumination,
            boolean halHandlesDisplayTouches,
            boolean resetLockoutRequiresHardwareAuthToken,
            @NonNull List<SensorLocationInternal> sensorLocations) {
        // IBiometricsFingerprint@2.1 handles lockout in the framework, so the challenge is not
@@ -58,6 +60,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
            resetLockoutRequiresHardwareAuthToken, false /* resetLockoutRequiresChallenge */);
        this.sensorType = sensorType;
        this.halControlsIllumination = halControlsIllumination;
        this.halHandlesDisplayTouches = halHandlesDisplayTouches;
        this.mSensorLocations = List.copyOf(sensorLocations);
    }

@@ -71,7 +74,8 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
            boolean resetLockoutRequiresHardwareAuthToken) {
        // TODO(b/179175438): Value should be provided from the HAL
        this(sensorId, strength, maxEnrollmentsPerUser, componentInfo, sensorType,
                false /* halControlsIllumination */, resetLockoutRequiresHardwareAuthToken,
                false /* halControlsIllumination */, false /* halHandlesDisplayTouches */,
                resetLockoutRequiresHardwareAuthToken,
                List.of(new SensorLocationInternal("" /* displayId */, 540 /* sensorLocationX */,
                        1636 /* sensorLocationY */, 130 /* sensorRadius */)));
    }
@@ -80,6 +84,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
        super(in);
        sensorType = in.readInt();
        halControlsIllumination = in.readBoolean();
        halHandlesDisplayTouches = in.readBoolean();
        mSensorLocations = in.createTypedArrayList(SensorLocationInternal.CREATOR);
    }

@@ -106,6 +111,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
        super.writeToParcel(dest, flags);
        dest.writeInt(sensorType);
        dest.writeBoolean(halControlsIllumination);
        dest.writeBoolean(halHandlesDisplayTouches);
        dest.writeTypedList(mSensorLocations);
    }

+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public final class HidlFingerprintSensorConfig extends SensorProps {
        commonProps.maxEnrollmentsPerUser = context.getResources().getInteger(
                R.integer.config_fingerprintMaxTemplatesPerUser);
        halControlsIllumination = false;
        halHandlesDisplayTouches = false;
        sensorLocations = new SensorLocation[1];

        // Non-empty workaroundLocations indicates that the sensor is SFPS.
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ public class FingerprintManagerTest {
                new ArrayList<>() /* componentInfo */,
                FingerprintSensorProperties.TYPE_UNKNOWN,
                true /* halControlsIllumination */,
                false /* halHandlesDisplayTouches */,
                true /* resetLockoutRequiresHardwareAuthToken */,
                new ArrayList<>() /* sensorLocations */));
    }
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ class FingerprintRepositoryImplTest : SysuiTestCase() {
                        ),
                        FingerprintSensorProperties.TYPE_REAR,
                        false /* halControlsIllumination */,
                        false /* halHandlesDisplayTouches */,
                        true /* resetLockoutRequiresHardwareAuthToken */,
                        listOf<SensorLocationInternal>(
                            SensorLocationInternal(
+2 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ constructor(
                listOf<ComponentInfoInternal>(),
                FingerprintSensorProperties.TYPE_UNKNOWN,
                false /* halControlsIllumination */,
                false /* halHandlesDisplayTouches */,
                true /* resetLockoutRequiresHardwareAuthToken */,
                listOf<SensorLocationInternal>(SensorLocationInternal.DEFAULT),
            )
@@ -172,6 +173,7 @@ constructor(
                listOf<ComponentInfoInternal>(),
                FingerprintSensorProperties.TYPE_UNKNOWN,
                false /* halControlsIllumination */,
                false /* halHandlesDisplayTouches */,
                true /* resetLockoutRequiresHardwareAuthToken */,
                listOf<SensorLocationInternal>(SensorLocationInternal.DEFAULT),
            )
Loading