From 929146ecff0476a2745eefaa930a08f1c2ee8d0c Mon Sep 17 00:00:00 2001 From: Ilya Matyukhin Date: Thu, 22 Apr 2021 00:29:01 -0700 Subject: [PATCH] Add Session#getEnrollmentConfig and better enum defaults Bug: 183738533 Bug: 181358178 Test: atest VtsHalBiometricsFaceTargetTest Change-Id: I45a60d58b0d32b7449bb7a2b04cc469b79454bcb --- .../biometrics/face/AcquiredInfo.aidl | 53 ++++++++--------- .../hardware/biometrics/face/BaseFrame.aidl | 2 +- .../biometrics/face/EnrollmentFrame.aidl | 2 +- .../biometrics/face/EnrollmentStage.aidl | 13 +++-- .../face/EnrollmentStageConfig.aidl | 2 +- .../hardware/biometrics/face/Error.aidl | 5 +- .../hardware/biometrics/face/ISession.aidl | 1 + .../hardware/biometrics/face/SensorProps.aidl | 2 +- .../biometrics/face/AcquiredInfo.aidl | 58 ++++++++++--------- .../biometrics/face/AuthenticationFrame.aidl | 1 - .../hardware/biometrics/face/BaseFrame.aidl | 2 +- .../biometrics/face/EnrollmentFrame.aidl | 2 +- .../biometrics/face/EnrollmentStage.aidl | 54 +++++++++-------- .../face/EnrollmentStageConfig.aidl | 2 +- .../hardware/biometrics/face/Error.aidl | 38 ++++-------- .../hardware/biometrics/face/ISession.aidl | 7 ++- .../hardware/biometrics/face/SensorProps.aidl | 2 +- biometrics/face/aidl/default/Session.cpp | 6 ++ biometrics/face/aidl/default/Session.h | 3 + 19 files changed, 133 insertions(+), 122 deletions(-) diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl index c19534c016..eaa43f3f9e 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -34,30 +34,31 @@ package android.hardware.biometrics.face; @Backing(type="byte") @VintfStability enum AcquiredInfo { - GOOD = 0, - INSUFFICIENT = 1, - TOO_BRIGHT = 2, - TOO_DARK = 3, - TOO_CLOSE = 4, - TOO_FAR = 5, - FACE_TOO_HIGH = 6, - FACE_TOO_LOW = 7, - FACE_TOO_RIGHT = 8, - FACE_TOO_LEFT = 9, - POOR_GAZE = 10, - NOT_DETECTED = 11, - TOO_MUCH_MOTION = 12, - RECALIBRATE = 13, - TOO_DIFFERENT = 14, - TOO_SIMILAR = 15, - PAN_TOO_EXTREME = 16, - TILT_TOO_EXTREME = 17, - ROLL_TOO_EXTREME = 18, - FACE_OBSCURED = 19, - START = 20, - SENSOR_DIRTY = 21, - VENDOR = 22, - FIRST_FRAME_RECEIVED = 23, - DARK_GLASSES_DETECTED = 24, - MOUTH_COVERING_DETECTED = 25, + UNKNOWN = 0, + GOOD = 1, + INSUFFICIENT = 2, + TOO_BRIGHT = 3, + TOO_DARK = 4, + TOO_CLOSE = 5, + TOO_FAR = 6, + FACE_TOO_HIGH = 7, + FACE_TOO_LOW = 8, + FACE_TOO_RIGHT = 9, + FACE_TOO_LEFT = 10, + POOR_GAZE = 11, + NOT_DETECTED = 12, + TOO_MUCH_MOTION = 13, + RECALIBRATE = 14, + TOO_DIFFERENT = 15, + TOO_SIMILAR = 16, + PAN_TOO_EXTREME = 17, + TILT_TOO_EXTREME = 18, + ROLL_TOO_EXTREME = 19, + FACE_OBSCURED = 20, + START = 21, + SENSOR_DIRTY = 22, + VENDOR = 23, + FIRST_FRAME_RECEIVED = 24, + DARK_GLASSES_DETECTED = 25, + MOUTH_COVERING_DETECTED = 26, } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl index aa51343281..67b5cf4169 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl @@ -34,7 +34,7 @@ package android.hardware.biometrics.face; @VintfStability parcelable BaseFrame { - android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.INSUFFICIENT; + android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN; int vendorCode; float pan; float tilt; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl index 982e759180..0ea10d6ddb 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -35,6 +35,6 @@ package android.hardware.biometrics.face; @VintfStability parcelable EnrollmentFrame { @nullable android.hardware.biometrics.face.Cell cell; - android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.FIRST_FRAME_RECEIVED; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; android.hardware.biometrics.face.BaseFrame data; } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl index 6be6e0bbdd..ce5679ab31 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -34,10 +34,11 @@ package android.hardware.biometrics.face; @Backing(type="byte") @VintfStability enum EnrollmentStage { - FIRST_FRAME_RECEIVED = 0, - WAITING_FOR_CENTERING = 1, - HOLD_STILL_IN_CENTER = 2, - ENROLLING_MOVEMENT_1 = 3, - ENROLLING_MOVEMENT_2 = 4, - ENROLLMENT_FINISHED = 5, + UNKNOWN = 0, + FIRST_FRAME_RECEIVED = 1, + WAITING_FOR_CENTERING = 2, + HOLD_STILL_IN_CENTER = 3, + ENROLLING_MOVEMENT_1 = 4, + ENROLLING_MOVEMENT_2 = 5, + ENROLLMENT_FINISHED = 6, } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl index 232bd52813..48db2cf615 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -34,6 +34,6 @@ package android.hardware.biometrics.face; @VintfStability parcelable EnrollmentStageConfig { - android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.FIRST_FRAME_RECEIVED; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; List cells; } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl index 0437f0708c..1a21661932 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl @@ -34,12 +34,13 @@ package android.hardware.biometrics.face; @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 = 8, - REENROLL_REQUIRED = 16, + VENDOR = 7, + REENROLL_REQUIRED = 8, } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl index 1ee3cafc81..d1c2c1dd47 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl @@ -36,6 +36,7 @@ package android.hardware.biometrics.face; interface ISession { void generateChallenge(); void revokeChallenge(in long challenge); + android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType); android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in android.hardware.common.NativeHandle previewSurface); android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); android.hardware.biometrics.common.ICancellationSignal detectInteraction(); diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl index c55a600eed..e6ea9f981e 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl @@ -35,7 +35,7 @@ package android.hardware.biometrics.face; @VintfStability parcelable SensorProps { android.hardware.biometrics.common.CommonProps commonProps; - android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.RGB; + android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.UNKNOWN; boolean halControlsPreview; int enrollPreviewWidth; int enrollPreviewHeight; diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl index a3b229e83a..cf68421062 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -19,18 +19,24 @@ package android.hardware.biometrics.face; @VintfStability @Backing(type="byte") enum AcquiredInfo { + /** + * Placeholder value used for default initialization of AcquiredInfo. This + * value means AcquiredInfo wasn't explicitly initialized and must be + * discarded by the recipient. + */ + UNKNOWN, /** * The acquired face data was good, no further user interaction is necessary. */ - GOOD = 0, + GOOD, /** * The acquired face data was too noisy or did not have sufficient detail. * This is a catch-all for all acquisition errors not captured by the other * constants. */ - INSUFFICIENT = 1, + INSUFFICIENT, /** * Because there was too much ambient light, the captured face data was too @@ -40,7 +46,7 @@ enum AcquiredInfo { * The user is expected to take action to retry the operation in better * lighting conditions when this is returned. */ - TOO_BRIGHT = 2, + TOO_BRIGHT, /** * Because there was not enough illumination, the captured face data was too @@ -50,7 +56,7 @@ enum AcquiredInfo { * The user is expected to take action to retry the operation in better * lighting conditions when this is returned. */ - TOO_DARK = 3, + TOO_DARK, /** * The detected face is too close to the sensor, and the image cannot be @@ -59,7 +65,7 @@ enum AcquiredInfo { * The user is expected to be informed to move further from the sensor when * this is returned. */ - TOO_CLOSE = 4, + TOO_CLOSE, /** * The detected face is too small, as the user might be too far away from @@ -68,7 +74,7 @@ enum AcquiredInfo { * The user is expected to be informed to move closer to the sensor when * this is returned. */ - TOO_FAR = 5, + TOO_FAR, /** * Only the upper part of the face was detected. The sensor's field of view @@ -77,7 +83,7 @@ enum AcquiredInfo { * The user should be informed to move up with respect to the sensor when * this is returned. */ - FACE_TOO_HIGH = 6, + FACE_TOO_HIGH, /** * Only the lower part of the face was detected. The sensor's field of view @@ -86,7 +92,7 @@ enum AcquiredInfo { * The user should be informed to move down with respect to the sensor when * this is returned. */ - FACE_TOO_LOW = 7, + FACE_TOO_LOW, /** * Only the right part of the face was detected. The sensor's field of view @@ -95,7 +101,7 @@ enum AcquiredInfo { * The user should be informed to move to the right with respect to the * sensor when this is returned. */ - FACE_TOO_RIGHT = 8, + FACE_TOO_RIGHT, /** * Only the left part of the face was detected. The sensor's field of view @@ -104,7 +110,7 @@ enum AcquiredInfo { * The user should be informed to move to the left with respect to the * sensor when this is returned. */ - FACE_TOO_LEFT = 9, + FACE_TOO_LEFT, /** * The user's eyes have strayed away from the sensor. If this message is @@ -112,7 +118,7 @@ enum AcquiredInfo { * can't be found in the frame, one of the other acquisition messages * must be sent, e.g. NOT_DETECTED. */ - POOR_GAZE = 10, + POOR_GAZE, /** * No face was detected within the sensor's field of view. @@ -120,7 +126,7 @@ enum AcquiredInfo { * The user should be informed to point the sensor to a face when this is * returned. */ - NOT_DETECTED = 11, + NOT_DETECTED, /** * Too much motion was detected. @@ -128,7 +134,7 @@ enum AcquiredInfo { * The user should be informed to keep their face steady relative to the * sensor. */ - TOO_MUCH_MOTION = 12, + TOO_MUCH_MOTION, /** * The sensor needs to be re-calibrated. This is an unexpected condition, @@ -137,20 +143,20 @@ enum AcquiredInfo { * re-enrolling. The expected response to this message is to direct the * user to re-enroll. */ - RECALIBRATE = 13, + RECALIBRATE, /** * The face is too different from a previous acquisition. This condition * only applies to enrollment. This can happen if the user passes the * device to someone else in the middle of enrollment. */ - TOO_DIFFERENT = 14, + TOO_DIFFERENT, /** * The face is too similar to a previous acquisition. This condition only * applies to enrollment. The user should change their pose. */ - TOO_SIMILAR = 15, + TOO_SIMILAR, /** * The magnitude of the pan angle of the user’s face with respect to the sensor’s @@ -162,7 +168,7 @@ enum AcquiredInfo { * * The user should be informed to look more directly at the camera. */ - PAN_TOO_EXTREME = 16, + PAN_TOO_EXTREME, /** * The magnitude of the tilt angle of the user’s face with respect to the sensor’s @@ -173,7 +179,7 @@ enum AcquiredInfo { * * The user should be informed to look more directly at the camera. */ - TILT_TOO_EXTREME = 17, + TILT_TOO_EXTREME, /** * The magnitude of the roll angle of the user’s face with respect to the sensor’s @@ -185,7 +191,7 @@ enum AcquiredInfo { * * The user should be informed to look more directly at the camera. */ - ROLL_TOO_EXTREME = 18, + ROLL_TOO_EXTREME, /** * The user’s face has been obscured by some object. @@ -193,7 +199,7 @@ enum AcquiredInfo { * The user should be informed to remove any objects from the line of sight from * the sensor to the user’s face. */ - FACE_OBSCURED = 19, + FACE_OBSCURED, /** * This message represents the earliest message sent at the beginning of the authentication @@ -202,33 +208,33 @@ enum AcquiredInfo { * will measure latency based on the time between the last START message and the onAuthenticated * callback. */ - START = 20, + START, /** * The sensor is dirty. The user should be informed to clean the sensor. */ - SENSOR_DIRTY = 21, + SENSOR_DIRTY, /** * Vendor-specific acquisition message. See ISessionCallback#onAcquired vendorCode * documentation. */ - VENDOR = 22, + VENDOR, /** * The first frame from the camera has been received. */ - FIRST_FRAME_RECEIVED = 23, + FIRST_FRAME_RECEIVED, /** * Dark glasses detected. This can be useful for providing relevant feedback to the user and * enabling an alternative authentication logic if the implementation supports it. */ - DARK_GLASSES_DETECTED = 24, + DARK_GLASSES_DETECTED, /** * A face mask or face covering detected. This can be useful for providing relevant feedback to * the user and enabling an alternative authentication logic if the implementation supports it. */ - MOUTH_COVERING_DETECTED = 25, + MOUTH_COVERING_DETECTED, } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl index 47cad3c61d..be61a20c6f 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl @@ -23,7 +23,6 @@ import android.hardware.biometrics.face.BaseFrame; */ @VintfStability parcelable AuthenticationFrame { - /** * The frame metadata. Can be used by the framework to provide user feedback. */ diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl index 85535f920d..58ad01a0c0 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl @@ -29,7 +29,7 @@ parcelable BaseFrame { * Information about the frame that can be used by the framework to provide feedback to the * user, for example ask the user to move their face in a certain way. */ - AcquiredInfo acquiredInfo = AcquiredInfo.INSUFFICIENT; + AcquiredInfo acquiredInfo = AcquiredInfo.UNKNOWN; /** * If acquiredInfo is set to AcquiredInfo::VENDOR. This is the index into the configuration diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl index ea0a502166..ecb0e79aca 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -33,7 +33,7 @@ parcelable EnrollmentFrame { /** * The enrollment stage for which this frame was captured. */ - EnrollmentStage stage = EnrollmentStage.FIRST_FRAME_RECEIVED; + EnrollmentStage stage = EnrollmentStage.UNKNOWN; /** * The frame metadata. Can be used by the framework to provide user feedback. diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl index bbc874fb0c..5974838e01 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -22,34 +22,40 @@ package android.hardware.biometrics.face; @VintfStability @Backing(type="byte") enum EnrollmentStage { + /** + * Placeholder value used for default initialization of EnrollmentStage. This + * value means EnrollmentStage wasn't explicitly initialized and must be + * discarded by the recipient. + */ + UNKNOWN, - /** - * HAL has obtained the first camera frame. - */ - FIRST_FRAME_RECEIVED, + /** + * HAL has obtained the first camera frame. + */ + FIRST_FRAME_RECEIVED, - /** - * HAL is waiting for the user's face to be centered. - */ - WAITING_FOR_CENTERING, + /** + * HAL is waiting for the user's face to be centered. + */ + WAITING_FOR_CENTERING, - /** - * HAL is expecting the user's face to stay centered. - */ - HOLD_STILL_IN_CENTER, + /** + * HAL is expecting the user's face to stay centered. + */ + HOLD_STILL_IN_CENTER, - /** - * Vendor defined movement 1. - */ - ENROLLING_MOVEMENT_1, + /** + * Vendor defined movement 1. + */ + ENROLLING_MOVEMENT_1, - /** - * Vendor defined movement 2. - */ - ENROLLING_MOVEMENT_2, + /** + * Vendor defined movement 2. + */ + ENROLLING_MOVEMENT_2, - /** - * HAL has finished the enrollment. - */ - ENROLLMENT_FINISHED, + /** + * HAL has finished the enrollment. + */ + ENROLLMENT_FINISHED, } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl index 3c31fcc977..a8fa9abc8e 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -24,7 +24,7 @@ parcelable EnrollmentStageConfig { /** * The stage that's being configured. */ - EnrollmentStage stage = EnrollmentStage.FIRST_FRAME_RECEIVED; + EnrollmentStage stage = EnrollmentStage.UNKNOWN; /** * Optional list of cells that must be completed to finish this stage. diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl index 6f3264b4b6..e99415ac36 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl @@ -20,22 +20,22 @@ package android.hardware.biometrics.face; @Backing(type="byte") enum Error { /** - * Reserved for testing and to keep subsequent numbering consistent with - * older interfaces. - * - * NO_ERROR = 0, + * Placeholder value used for default initialization of Error. This value + * means Error wasn't explicitly initialized and must be discarded by the + * recipient. */ + UNKNOWN, /** * A hardware error has occurred that cannot be resolved. Try again later. */ - HW_UNAVAILABLE = 1, + HW_UNAVAILABLE, /** * The current operation could not be completed, e.g. the sensor was unable * to process the current image or the HAT was invalid. */ - UNABLE_TO_PROCESS = 2, + UNABLE_TO_PROCESS, /** * The current operation took too long to complete. This is intended to @@ -48,48 +48,34 @@ enum Error { * indicate that the implementation is no longer looking and the framework * should restart the operation on the next user interaction. */ - TIMEOUT = 3, + TIMEOUT, /** * The current operation could not be completed because there is not enough * storage space remaining to do so. */ - NO_SPACE = 4, + NO_SPACE, /** * The current operation has been cancelled. This may happen if a new * request (authenticate, remove, enumerate, enroll) is initiated while * an on-going operation is in progress, or if cancel() was called. */ - CANCELED = 5, + CANCELED, /** * The current remove operation could not be completed; the face template * provided could not be removed. */ - UNABLE_TO_REMOVE = 6, - - /** - * Reserved to maintain backwards compatibility. See - * ISessionCallback#onLockoutTimed instead. - * - * LOCKOUT = 7, - */ + UNABLE_TO_REMOVE, /** * Used to enable a vendor-specific error message. */ - VENDOR = 8, - - /** - * Reserved to maintain backwards compatibility. See - * ISessionCallback#onLockoutPermanent instead. - * - * LOCKOUT_PERMANENT = 9 - */ + VENDOR, /** * Authentication cannot be performed because re-enrollment is required. */ - REENROLL_REQUIRED = 16, + REENROLL_REQUIRED, } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl index 12911e3ba7..a9a8c16cf2 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl @@ -17,6 +17,7 @@ package android.hardware.biometrics.face; import android.hardware.biometrics.common.ICancellationSignal; +import android.hardware.biometrics.face.EnrollmentStageConfig; import android.hardware.biometrics.face.EnrollmentType; import android.hardware.biometrics.face.Feature; import android.hardware.common.NativeHandle; @@ -104,9 +105,9 @@ interface ISession { * each of the stages. * * @param enrollmentType See the EnrollmentType enum. - * @return A list of EnrollmentStageConfig that describes each enrollment stage. - * - List getEnrollmentConfig(in EnrollmentType enrollmentType); + * @return An EnrollmentStageConfig array that describes each enrollment stage. + */ + EnrollmentStageConfig[] getEnrollmentConfig(in EnrollmentType enrollmentType); /** * enroll: diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl index b11b436098..994324d068 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl @@ -29,7 +29,7 @@ parcelable SensorProps { /** * A statically configured sensor type representing this face sensor. */ - FaceSensorType sensorType = FaceSensorType.RGB; + FaceSensorType sensorType = FaceSensorType.UNKNOWN; /** * Whether or not the HAL is responsible for showing the face enrollment preview to the user. diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp index 4438d35ba4..d980c5f892 100644 --- a/biometrics/face/aidl/default/Session.cpp +++ b/biometrics/face/aidl/default/Session.cpp @@ -52,6 +52,12 @@ ndk::ScopedAStatus Session::revokeChallenge(int64_t challenge) { return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Session::getEnrollmentConfig(EnrollmentType /*enrollmentType*/, + std::vector* return_val) { + *return_val = {}; + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus Session::enroll( const keymaster::HardwareAuthToken& /*hat*/, EnrollmentType /*enrollmentType*/, const std::vector& /*features*/, const NativeHandle& /*previewSurface*/, diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h index c89985e31e..caf81f8702 100644 --- a/biometrics/face/aidl/default/Session.h +++ b/biometrics/face/aidl/default/Session.h @@ -34,6 +34,9 @@ class Session : public BnSession { ndk::ScopedAStatus revokeChallenge(int64_t challenge) override; + ndk::ScopedAStatus getEnrollmentConfig(EnrollmentType enrollmentType, + std::vector* return_val) override; + ndk::ScopedAStatus enroll(const keymaster::HardwareAuthToken& hat, EnrollmentType enrollmentType, const std::vector& features, const NativeHandle& previewSurface,