From bad76851cfda2f19e38b758aa95d6e73ddd47c86 Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Wed, 11 Nov 2020 13:23:35 -0800 Subject: [PATCH] Add additional face SensorProps Fixes: 168541000 Test: m android.hardware.biometrics.face-update-api Test: m android.hardware.biometrics.face-service.example Change-Id: I664fe1f641e09217b27aef232e39ba7d6fa1e171 --- .../hardware/biometrics/face/SensorProps.aidl | 5 +++ .../hardware/biometrics/face/SensorProps.aidl | 31 +++++++++++++++++++ biometrics/face/aidl/default/Face.cpp | 5 +++ 3 files changed, 41 insertions(+) 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 9f977f54af..365ae58a46 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 @@ -21,4 +21,9 @@ parcelable SensorProps { android.hardware.biometrics.common.CommonProps commonProps; android.hardware.biometrics.face.FaceSensorType sensorType; boolean halControlsPreview; + int enrollPreviewWidth; + int enrollPreviewHeight; + float enrollTranslationX; + float enrollTranslationY; + float enrollPreviewScale; } diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl index 53cc44e7ec..9c2f9a1734 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl @@ -39,5 +39,36 @@ parcelable SensorProps { * the framework. */ boolean halControlsPreview; + + /** + * For implementations where the HAL manages the preview, this is the width, in pixels, of each + * frame that the camera is set up to output. + */ + int enrollPreviewWidth; + + /** + * For implementations where the HAL manages the preview, this is the height, in pixels, of + * each frame that the camera is set up to output. + */ + int enrollPreviewHeight; + + /** + * For implementations where the HAL manages the preview, this is the distance in pixels that + * the enrollment preview should be translated. This is typically used by devices where the + * camera used for enrollment preview is not centered. + */ + float enrollTranslationX; + + /** + * For implementations where the HAL manages the preview, this is the distance in pixels that + * the enrollment preview should be translated. + */ + float enrollTranslationY; + + /** + * For implementations where the HAL manages the preview, this is the scale factor that should + * be applied when configuring the preview texture. + */ + float enrollPreviewScale; } diff --git a/biometrics/face/aidl/default/Face.cpp b/biometrics/face/aidl/default/Face.cpp index 1526245c70..929c7e7703 100644 --- a/biometrics/face/aidl/default/Face.cpp +++ b/biometrics/face/aidl/default/Face.cpp @@ -46,6 +46,11 @@ ndk::ScopedAStatus Face::getSensorProps(std::vector* return_val) { props.commonProps = std::move(commonProps); props.sensorType = kSensorType; props.halControlsPreview = kHalControlsPreview; + props.enrollPreviewWidth = 1080; + props.enrollPreviewHeight = 1920; + props.enrollTranslationX = 100.f; + props.enrollTranslationY = 50.f; + props.enrollPreviewScale = 1.f; *return_val = {std::move(props)}; return ndk::ScopedAStatus::ok();