From 88ded642f2b59601e13573a9ee0a327b003be366 Mon Sep 17 00:00:00 2001 From: Austin Delgado Date: Thu, 16 Feb 2023 11:34:50 -0800 Subject: [PATCH] Update fingerprint AIDL for Android U 1. Adds sensor shape and touch detection configuration. 2. Adds onPointerCancelWithContext and setIgnoreDisplayTouches. 3. Adds LIFT_TOO_SOON constant to AcquiredInfo. 4. Deprecates SensorLocation displayId, onPointerDown, and onPointerUp. Bug: 266476972 Test: m android.hardware.biometrics.fingerprint-update-api Test: built locally Change-Id: I3aae3c7f8a65d5805f3dd583330407c255ca1369 --- .../biometrics/fingerprint/AcquiredInfo.aidl | 27 +++---- .../biometrics/fingerprint/Error.aidl | 18 ++--- .../fingerprint/FingerprintSensorType.aidl | 12 ++-- .../biometrics/fingerprint/ISession.aidl | 8 +++ .../fingerprint/PointerContext.aidl | 12 ++-- .../fingerprint/SensorLocation.aidl | 4 ++ .../biometrics/fingerprint/SensorProps.aidl | 1 + .../biometrics/fingerprint/SensorShape.aidl | 40 +++++++++++ .../fingerprint/TouchDetectionParameters.aidl | 40 +++++++++++ .../biometrics/fingerprint/AcquiredInfo.aidl | 5 ++ .../biometrics/fingerprint/ISession.aidl | 70 ++++++++++++++++++- .../fingerprint/SensorLocation.aidl | 11 ++- .../biometrics/fingerprint/SensorProps.aidl | 7 ++ .../biometrics/fingerprint/SensorShape.aidl | 29 ++++++++ .../fingerprint/TouchDetectionParameters.aidl | 36 ++++++++++ .../fingerprint/aidl/default/Fingerprint.cpp | 3 +- .../fingerprint/aidl/default/Session.cpp | 8 +++ .../aidl/default/include/Session.h | 4 ++ 18 files changed, 297 insertions(+), 38 deletions(-) create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl create mode 100644 biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl create mode 100644 biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl index 0cc619f991..89f76f437b 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -35,17 +35,18 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @Backing(type="byte") @VintfStability enum AcquiredInfo { - UNKNOWN = 0, - GOOD = 1, - PARTIAL = 2, - INSUFFICIENT = 3, - SENSOR_DIRTY = 4, - TOO_SLOW = 5, - TOO_FAST = 6, - VENDOR = 7, - START = 8, - TOO_DARK = 9, - TOO_BRIGHT = 10, - IMMOBILE = 11, - RETRYING_CAPTURE = 12, + UNKNOWN, + GOOD, + PARTIAL, + INSUFFICIENT, + SENSOR_DIRTY, + TOO_SLOW, + TOO_FAST, + VENDOR, + START, + TOO_DARK, + TOO_BRIGHT, + IMMOBILE, + RETRYING_CAPTURE, + LIFT_TOO_SOON, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl index 45ce2eb3fe..d3592a1f09 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl @@ -35,13 +35,13 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @Backing(type="byte") @VintfStability enum Error { - UNKNOWN = 0, - HW_UNAVAILABLE = 1, - UNABLE_TO_PROCESS = 2, - TIMEOUT = 3, - NO_SPACE = 4, - CANCELED = 5, - UNABLE_TO_REMOVE = 6, - VENDOR = 7, - BAD_CALIBRATION = 8, + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + BAD_CALIBRATION, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl index 67af20d872..381aaf7365 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl @@ -35,10 +35,10 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @Backing(type="byte") @VintfStability enum FingerprintSensorType { - UNKNOWN = 0, - REAR = 1, - UNDER_DISPLAY_ULTRASONIC = 2, - UNDER_DISPLAY_OPTICAL = 3, - POWER_BUTTON = 4, - HOME_BUTTON = 5, + UNKNOWN, + REAR, + UNDER_DISPLAY_ULTRASONIC, + UNDER_DISPLAY_OPTICAL, + POWER_BUTTON, + HOME_BUTTON, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl index f30585529d..4fdcefc8ff 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl @@ -46,7 +46,13 @@ interface ISession { void invalidateAuthenticatorId(); void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); void close(); + /** + * @deprecated use onPointerDownWithContext instead. + */ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); + /** + * @deprecated use onPointerUpWithContext instead. + */ void onPointerUp(in int pointerId); void onUiReady(); android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); @@ -55,4 +61,6 @@ interface ISession { void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onContextChanged(in android.hardware.biometrics.common.OperationContext context); + void onPointerCancelWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void setIgnoreDisplayTouches(in boolean shouldIgnore); } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl index 999b324abd..d9bf0854ca 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -35,12 +35,12 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @JavaDerive(equals=true) @VintfStability parcelable PointerContext { - int pointerId = -1; - float x = 0.000000f; - float y = 0.000000f; - float minor = 0.000000f; - float major = 0.000000f; - float orientation = 0.000000f; + int pointerId = (-1) /* -1 */; + float x = 0f; + float y = 0f; + float minor = 0f; + float major = 0f; + float orientation = 0f; boolean isAod = false; long time = 0; long gestureStart = 0; diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl index dc6a62de6b..965576e822 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -35,9 +35,13 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @VintfStability parcelable SensorLocation { + /** + * @deprecated use the display field instead. This field was never used. + */ int displayId; int sensorLocationX; int sensorLocationY; int sensorRadius; String display = ""; + android.hardware.biometrics.fingerprint.SensorShape sensorShape = android.hardware.biometrics.fingerprint.SensorShape.CIRCLE; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl index a77d5f2eee..a97d819dba 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -42,4 +42,5 @@ parcelable SensorProps { boolean supportsDetectInteraction; boolean halHandlesDisplayTouches; boolean halControlsIllumination; + @nullable android.hardware.biometrics.fingerprint.TouchDetectionParameters touchDetectionParameters; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..f673b1c806 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..2e3ec4f574 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +parcelable TouchDetectionParameters { + float targetSize = 1.0f; + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl index d3aa98a87d..2cdc196f41 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -98,4 +98,9 @@ enum AcquiredInfo { * However, RETRYING_CAPTURE must not be sent after ACQUIRED_GOOD is sent. */ RETRYING_CAPTURE, + + /** + * Fingerprint was lifted before the capture completed. + */ + LIFT_TOO_SOON, } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl index f4f7804f52..83e7bbc43f 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl @@ -420,6 +420,8 @@ interface ISession { * @param y The distance in pixels from the top edge of the display. * @param minor See android.view.MotionEvent#getTouchMinor * @param major See android.view.MotionEvent#getTouchMajor + * + * @deprecated use onPointerDownWithContext instead. */ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); @@ -434,6 +436,8 @@ interface ISession { * ISession#enroll, ISession#detectInteraction. * * @param pointerId See android.view.MotionEvent#getPointerId + * + * @deprecated use onPointerUpWithContext instead. */ void onPointerUp(in int pointerId); @@ -469,15 +473,77 @@ interface ISession { /** See ISession#detectInteraction() */ ICancellationSignal detectInteractionWithContext(in OperationContext context); - /** See ISession#onPointerDown(int, int, int, float, float) */ + /** + * onPointerDownWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked erroneously by the framework for sensors + * of other types, the HAL must treat this as a no-op and return immediately. + * + * Notifies the HAL that a finger entered the sensor area. This operation can be invoked + * regardless of the current state of the HAL. + * + * Note that for sensors which require illumination, for example + * FingerprintSensorType::UNDER_DISPLAY_OPTICAL, this is a good time to start illuminating. + * + * @param context See PointerContext + */ void onPointerDownWithContext(in PointerContext context); - /** See ISession#onPointerUp(int) */ + /** + * onPointerUpWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked for sensors of other types, the HAL must + * treat this as a no-op and return immediately. + * + * Notifies the HAL that a finger left the sensor area. This operation can be invoked regardless + * of the current state of the HAL. + * + * @param context See PointerContext + */ void onPointerUpWithContext(in PointerContext context); /** + * onContextChanged: + * * This may be called while an authenticate, detect interaction, or enrollment operation is * running when the context changes. */ void onContextChanged(in OperationContext context); + + /** + * onPointerCancelWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked for sensors of other types, the HAL must + * treat this as a no-op and return immediately. + * + * Notifies the HAL that if there were fingers within the sensor area, they are no longer being + * tracked. The fingers may or may not still be on the sensor. This operation can be invoked + * regardless of the current state of the HAL. + * + * @param context See PointerContext + */ + void onPointerCancelWithContext(in PointerContext context); + + /** + * setIgnoreDisplayTouches: + * + * This operation only applies to sensors that have SensorProps#halHandlesDisplayTouches + * set to true. For all other sensors this is a no-op. + * + * Instructs the HAL whether to ignore display touches. This can be useful to avoid unintended + * fingerprint captures during certain UI interactions. For example, when entering a lockscreen + * PIN, some of the touches might overlap with the fingerprint sensor. Those touches should be + * ignored to avoid unintended authentication attempts. + * + * This flag must default to false when the HAL starts. + * + * The framework is responsible for both setting the flag to true and resetting it to false + * whenever it's appropriate. + * + * @param shouldIgnore whether the display touches should be ignored. + */ + void setIgnoreDisplayTouches(in boolean shouldIgnore); } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl index a065a7ce7b..fd8c7fc2d5 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -15,13 +15,16 @@ */ package android.hardware.biometrics.fingerprint; + +import android.hardware.biometrics.fingerprint.SensorShape; + /** * @hide */ @VintfStability parcelable SensorLocation { /** - * Deprecated use the display field instead. This field was never used. + * @deprecated use the display field instead. This field was never used. */ int displayId; @@ -59,4 +62,10 @@ parcelable SensorLocation { * for each display from which the sensor is accessible from. */ String display = ""; + + /** + * The shape of the sensor if applicable. Most useful for the sensor of type + * SensorType::UNDER_DISPLAY_*. + */ + SensorShape sensorShape = SensorShape.CIRCLE; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl index d4e9ec6f38..853aae48ad 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -19,6 +19,8 @@ package android.hardware.biometrics.fingerprint; import android.hardware.biometrics.common.CommonProps; import android.hardware.biometrics.fingerprint.FingerprintSensorType; import android.hardware.biometrics.fingerprint.SensorLocation; +import android.hardware.biometrics.fingerprint.TouchDetectionParameters; + /** * @hide */ @@ -72,4 +74,9 @@ parcelable SensorProps { * This value must be ignored for sensors that aren't optical UDFPS. */ boolean halControlsIllumination; + + /** + * Parameters used for fingerprint touch detection. + */ + @nullable TouchDetectionParameters touchDetectionParameters; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..1279332ce0 --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.fingerprint; +/** + * This is most useful for sensors configured as FingerprintSensorType::UNDER_DISPLAY_OPTICAL, + * as it's used to compute the on-screen sensor boundaries for the touch detection algorithm. + * + * @hide + */ +@VintfStability +@Backing(type="byte") +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..bf117a33e6 --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.fingerprint; + +/** + * @hide + */ +@VintfStability +parcelable TouchDetectionParameters { + /** + * The percentage of the sensor that is considered the target. Value is required to be within + * [0.0, 1.0]. The target area expands outwards from center matching the sensorShape. Some + * portion of the touch must be within the target to be considered a valid touch. + */ + float targetSize = 1.0f; + + /** + * The minimum percentage overlap needed on the sensor to be considered a valid touch. Value is + * required to be within [0.0, 1.0]. + */ + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.cpp b/biometrics/fingerprint/aidl/default/Fingerprint.cpp index be932246bd..7808a13d16 100644 --- a/biometrics/fingerprint/aidl/default/Fingerprint.cpp +++ b/biometrics/fingerprint/aidl/default/Fingerprint.cpp @@ -90,7 +90,8 @@ ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector* out) { navigationGuesture, detectInteraction, displayTouch, - controlIllumination}}; + controlIllumination, + std::nullopt}}; return ndk::ScopedAStatus::ok(); } diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp index 7ab5af3c4d..38d6a134e2 100644 --- a/biometrics/fingerprint/aidl/default/Session.cpp +++ b/biometrics/fingerprint/aidl/default/Session.cpp @@ -289,4 +289,12 @@ ndk::ScopedAStatus Session::onContextChanged(const common::OperationContext& /*c return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Session::onPointerCancelWithContext(const PointerContext& /*context*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Session::setIgnoreDisplayTouches(bool /*shouldIgnore*/) { + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/Session.h b/biometrics/fingerprint/aidl/default/include/Session.h index 104d819ff0..b596d9e2a9 100644 --- a/biometrics/fingerprint/aidl/default/include/Session.h +++ b/biometrics/fingerprint/aidl/default/include/Session.h @@ -97,6 +97,10 @@ class Session : public BnSession { ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override; + ndk::ScopedAStatus onPointerCancelWithContext(const PointerContext& context) override; + + ndk::ScopedAStatus setIgnoreDisplayTouches(bool shouldIgnore) override; + bool isClosed(); private: