From 5f0a38d22eb8cf0a8034b5aa763af220ded754b9 Mon Sep 17 00:00:00 2001 From: Giovanni Ricca Date: Thu, 30 Nov 2023 18:32:08 +0100 Subject: [PATCH] interfaces: fingerprints: extension: 1.0: Reverse the remaining interfaces Change-Id: I53175dc6125b485c6007685938181a169f4d3b87 --- .../fingerprints/extension/1.0/Android.bp | 17 +++++ .../extension/1.0/ICalibrationCallback.hal | 17 +++++ .../extension/1.0/ICryptCallback.hal | 11 +++ .../1.0/IFingerprintAuthenticator.hal | 17 +++++ .../extension/1.0/IFingerprintCalibration.hal | 13 ++++ .../extension/1.0/IFingerprintEngineering.hal | 68 +++++++++++++++++++ .../extension/1.0/IFingerprintNavigation.hal | 28 ++++---- .../extension/1.0/IFingerprintOptical.hal | 52 ++++++++++++++ .../1.0/IFingerprintOpticalCallback.hal | 17 +++++ .../1.0/IFingerprintRecalibration.hal | 17 +++++ .../extension/1.0/IFingerprintSenseTouch.hal | 30 ++++++++ .../extension/1.0/IFingerprintSensorTest.hal | 53 +++++++++++++++ .../1.0/IIlluminationTuningCallback.hal | 11 +++ .../extension/1.0/IImageCaptureCallback.hal | 30 ++++++++ .../extension/1.0/IImageInjectionCallback.hal | 13 ++++ .../extension/1.0/IRecalibrationCallback.hal | 13 ++++ .../extension/1.0/ISensorTestCallback.hal | 28 ++++++++ .../1.0/ISensorTestCaptureCallback.hal | 13 ++++ .../extension/1.0/IVerifyUserCallback.hal | 13 ++++ 19 files changed, 449 insertions(+), 12 deletions(-) create mode 100644 interfaces/fingerprints/extension/1.0/ICalibrationCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/ICryptCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintAuthenticator.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintCalibration.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintEngineering.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintOptical.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintOpticalCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintRecalibration.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintSenseTouch.hal create mode 100644 interfaces/fingerprints/extension/1.0/IFingerprintSensorTest.hal create mode 100644 interfaces/fingerprints/extension/1.0/IIlluminationTuningCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/IImageCaptureCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/IImageInjectionCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/IRecalibrationCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/ISensorTestCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/ISensorTestCaptureCallback.hal create mode 100644 interfaces/fingerprints/extension/1.0/IVerifyUserCallback.hal diff --git a/interfaces/fingerprints/extension/1.0/Android.bp b/interfaces/fingerprints/extension/1.0/Android.bp index bcb5bbf..b1b6359 100644 --- a/interfaces/fingerprints/extension/1.0/Android.bp +++ b/interfaces/fingerprints/extension/1.0/Android.bp @@ -5,7 +5,24 @@ hidl_interface { root: "com.fingerprints", system_ext_specific: true, srcs: [ + "ICalibrationCallback.hal", + "ICryptCallback.hal", + "IFingerprintAuthenticator.hal", + "IFingerprintCalibration.hal", + "IFingerprintEngineering.hal", "IFingerprintNavigation.hal", + "IFingerprintOptical.hal", + "IFingerprintOpticalCallback.hal", + "IFingerprintRecalibration.hal", + "IFingerprintSenseTouch.hal", + "IFingerprintSensorTest.hal", + "IIlluminationTuningCallback.hal", + "IImageCaptureCallback.hal", + "IImageInjectionCallback.hal", + "IRecalibrationCallback.hal", + "ISensorTestCallback.hal", + "ISensorTestCaptureCallback.hal", + "IVerifyUserCallback.hal", ], interfaces: [ "android.hidl.base@1.0", diff --git a/interfaces/fingerprints/extension/1.0/ICalibrationCallback.hal b/interfaces/fingerprints/extension/1.0/ICalibrationCallback.hal new file mode 100644 index 0000000..4be0742 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/ICalibrationCallback.hal @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface ICalibrationCallback { + oneway onStatus(uint32_t code); + + oneway onError(uint32_t error); + + oneway onInitTransferData(uint32_t totalSize); + + oneway onTransferData(vec buffer, uint32_t remaning); +}; diff --git a/interfaces/fingerprints/extension/1.0/ICryptCallback.hal b/interfaces/fingerprints/extension/1.0/ICryptCallback.hal new file mode 100644 index 0000000..61c410d --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/ICryptCallback.hal @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface ICryptCallback { + oneway onResult(uint32_t result); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintAuthenticator.hal b/interfaces/fingerprints/extension/1.0/IFingerprintAuthenticator.hal new file mode 100644 index 0000000..f4e2bb7 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintAuthenticator.hal @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +import IVerifyUserCallback; + +interface IFingerprintAuthenticator { + verifyUser(IVerifyUserCallback callback, vec fido_auth_input_1, vec fido_auth_input_2, vec dstAppName) generates (int32_t result); + + isUserValid(uint64_t userId) generates (bool userValid); + + oneway cancel(); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintCalibration.hal b/interfaces/fingerprints/extension/1.0/IFingerprintCalibration.hal new file mode 100644 index 0000000..851d2ef --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintCalibration.hal @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +import ICalibrationCallback; + +interface IFingerprintCalibration { + oneway calibrate(ICalibrationCallback callback); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintEngineering.hal b/interfaces/fingerprints/extension/1.0/IFingerprintEngineering.hal new file mode 100644 index 0000000..e39998d --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintEngineering.hal @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +import IImageCaptureCallback; +import IImageInjectionCallback; +import ICryptCallback; +import ICalibrationCallback; +import IIlluminationTuningCallback; + +interface IFingerprintEngineering { + struct SensorSize { + int32_t width; + int32_t height; + }; + + getSensorSize() generates (SensorSize sensorSize); + + oneway startImageSubscription(IImageCaptureCallback callback); + + oneway stopImageSubscription(); + + oneway startImageInjection(IImageInjectionCallback callback); + + oneway stopImageInjection(); + + oneway startCapture(IImageCaptureCallback callback, uint32_t mode); + + oneway cancelCapture(); + + oneway setEnrollToken(vec token); + + getEnrollChallenge() generates (int64_t enrollChallenge); + + getBuildInfo() generates (string buildInfo); + + oneway cryptBlob(ICryptCallback callback, uint32_t mode); + + oneway startCalibration(ICalibrationCallback callback); + + oneway captureCalibration(ICalibrationCallback callback, uint32_t type, uint32_t level); + + oneway finishCalibration(ICalibrationCallback callback, uint32_t level); + + oneway saveCalibration(ICalibrationCallback callback, uint32_t level); + + oneway saveCalibrationDecrypted(ICalibrationCallback callback, uint32_t level); + + oneway cancelCalibration(ICalibrationCallback callback); + + oneway getCalibrationData(ICalibrationCallback callback); + + oneway startBarTarget(ICalibrationCallback callback); + + oneway captureBarTarget(ICalibrationCallback callback, uint32_t level); + + oneway finishBarTarget(ICalibrationCallback callback, uint32_t level); + + oneway saveBarTarget(ICalibrationCallback callback, uint32_t level); + + oneway cancelBarTarget(ICalibrationCallback callback); + + oneway setIlluminationLevel(IIlluminationTuningCallback callback, uint32_t level); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintNavigation.hal b/interfaces/fingerprints/extension/1.0/IFingerprintNavigation.hal index 02755fe..5c04a99 100644 --- a/interfaces/fingerprints/extension/1.0/IFingerprintNavigation.hal +++ b/interfaces/fingerprints/extension/1.0/IFingerprintNavigation.hal @@ -1,22 +1,26 @@ /* - * Copyright (C) 2021 The LineageOS Project + * Copyright (C) 2023 The LineageOS 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. + * SPDX-License-Identifier: Apache-2.0 */ package com.fingerprints.extension@1.0; interface IFingerprintNavigation { + struct NavigationConfig { + int32_t tapNoImageMaxThreshold; + int32_t holdNoImageMinThreshold; + int32_t doubleClickTimeInterval; + int32_t tapImageTransMaxThreshold; + int32_t swipeImageTransMinThreshold; + int32_t backGroundAlgo; + }; + setNavigation(bool enabled); + + getNavigationConfig() generates (NavigationConfig navigationConfig); + + oneway setNavigationConfig(NavigationConfig navigationConfig); + isEnabled() generates (bool isEnabled); }; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintOptical.hal b/interfaces/fingerprints/extension/1.0/IFingerprintOptical.hal new file mode 100644 index 0000000..2383112 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintOptical.hal @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +import IFingerprintOpticalCallback; + +interface IFingerprintOptical { + struct HotZoneData { + int32_t left; + int32_t right; + int32_t top; + int32_t bottom; + int32_t update; + }; + + struct TouchEventData { + int32_t hotzone_top; + int32_t hotzone_left; + int32_t hotzone_right; + int32_t hotzone_bottom; + int32_t pos_x; + int32_t pos_y; + float pressure; + float size; + int32_t major; + int32_t minor; + }; + + oneway setNotify(IFingerprintOpticalCallback callback); + + oneway setIlluminationStatus(uint32_t value); + + oneway etFingerListenerStatus(uint32_t value); + + setExposure(uint16_t exposureTime) generates (bool result); + + getExposure() generates (int16_t retVal); + + setAnalogGain(uint16_t gain) generates (bool result); + + getAnalogGain() generates (int16_t retVal); + + oneway setHotZoneData(HotZoneData hotZoneData); + + oneway setTouchEventData(TouchEventData touchEventData); + + getToutchEventData() generates (TouchEventData touchEventData); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintOpticalCallback.hal b/interfaces/fingerprints/extension/1.0/IFingerprintOpticalCallback.hal new file mode 100644 index 0000000..6e4fc1e --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintOpticalCallback.hal @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IFingerprintOpticalCallback { + oneway onStartWaitingForFinger(); + + oneway onStopWaitingForFinger(); + + oneway onFingerDown(); + + oneway onFingerLost(); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintRecalibration.hal b/interfaces/fingerprints/extension/1.0/IFingerprintRecalibration.hal new file mode 100644 index 0000000..960cb47 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintRecalibration.hal @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +import IRecalibrationCallback; + +interface IFingerprintRecalibration { + oneway recalibrate(vec token, IRecalibrationCallback callback); + + preRecalibrate() generates (int64_t challenge); + + oneway cancel(); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintSenseTouch.hal b/interfaces/fingerprints/extension/1.0/IFingerprintSenseTouch.hal new file mode 100644 index 0000000..07d1406 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintSenseTouch.hal @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IFingerprintSenseTouch { + struct SenseTouchConfig { + bool success; + int32_t version; + int32_t ground; + int32_t triggerThreshold; + int32_t untriggerThreshold; + bool authTriggerOnDown; + bool authTriggerOnUp; + int32_t authButtonTimeoutMs; + }; + + getForce() generates (int32_t force); + + isSupported() generates (bool isSupported); + + finishCalibration(uint32_t ground, uint32_t threshold) generates (bool result); + + setAuthMode(uint32_t mode, uint32_t buttonTimeoutMs) generates (bool result); + + readConfig() generates (SenseTouchConfig senseTouchConfig); +}; diff --git a/interfaces/fingerprints/extension/1.0/IFingerprintSensorTest.hal b/interfaces/fingerprints/extension/1.0/IFingerprintSensorTest.hal new file mode 100644 index 0000000..17c33f5 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IFingerprintSensorTest.hal @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +import ISensorTestCaptureCallback; +import ISensorTestCallback; + +interface IFingerprintSensorTest { + struct SensorInfo { + int32_t sensorDieValidFlag; + int32_t hardwareId; + string lotId; + int32_t waferId; + int32_t waferPositionX; + int32_t waferPositionY; + string productionTimestamp; + int32_t companionDieValidFlag; + int32_t companionChipHardwareId; + string companionChipLotId; + int32_t vendorHwValidFlag; + vec vendorData; + int32_t totalNumOtpBitErrors; + int32_t maxNumOtpBitErrorsInByte; + int32_t productType; + }; + + struct SensorTest { + string name; + string description; + bool waitForFingerDown; + string rubberStampType; + }; + + struct SensorTestInput { + string testLimitsKeyValuePair; + }; + + getSensorInfo() generates (SensorInfo sensorInfo); + + getSensorTests() generates (vec sensorTests); + + oneway runSensorTest(ISensorTestCallback callback, SensorTest test, SensorTestInput input); + + oneway cancelSensorTest(); + + oneway capture(ISensorTestCaptureCallback callback, bool waitForFinger, bool uncalibrated); + + oneway cancelCapture(); +}; diff --git a/interfaces/fingerprints/extension/1.0/IIlluminationTuningCallback.hal b/interfaces/fingerprints/extension/1.0/IIlluminationTuningCallback.hal new file mode 100644 index 0000000..824d1b5 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IIlluminationTuningCallback.hal @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IIlluminationTuningCallback { + oneway onResult(uint32_t code); +}; diff --git a/interfaces/fingerprints/extension/1.0/IImageCaptureCallback.hal b/interfaces/fingerprints/extension/1.0/IImageCaptureCallback.hal new file mode 100644 index 0000000..d709a2b --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IImageCaptureCallback.hal @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IImageCaptureCallback { + struct ImageCaptureData { + int32_t mode; + int32_t captureResult; + int32_t identifyResult; + int32_t templateUpdateResult; + int32_t enrollResult; + int32_t cacResult; + int32_t userId; + int32_t remainingSamples; + int32_t coverage; + int32_t quality; + vec rawImage; + vec enhancedImage; + }; + + oneway onImage(ImageCaptureData imageCaptureData); + + oneway onImageTransferData(uint8_t type, vec buffer); + + oneway onImageFinish(); +}; diff --git a/interfaces/fingerprints/extension/1.0/IImageInjectionCallback.hal b/interfaces/fingerprints/extension/1.0/IImageInjectionCallback.hal new file mode 100644 index 0000000..56eff23 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IImageInjectionCallback.hal @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IImageInjectionCallback { + onInject() generates (vec imageData); + + oneway onCancel(); +}; diff --git a/interfaces/fingerprints/extension/1.0/IRecalibrationCallback.hal b/interfaces/fingerprints/extension/1.0/IRecalibrationCallback.hal new file mode 100644 index 0000000..7af7572 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IRecalibrationCallback.hal @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IRecalibrationCallback { + oneway onStatus(uint32_t code, bool imageDecision, uint32_t imageQuality, uint32_t pnQuality, uint32_t progress); + + oneway onError(uint32_t error); +}; diff --git a/interfaces/fingerprints/extension/1.0/ISensorTestCallback.hal b/interfaces/fingerprints/extension/1.0/ISensorTestCallback.hal new file mode 100644 index 0000000..ab76c8d --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/ISensorTestCallback.hal @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface ISensorTestCallback { + struct SensorTestResult { + int32_t resultCode; + string resultString; + int32_t errorCode; + string errorString; + vec imageData; + string log; + }; + + oneway onResult(SensorTestResult result); + + onResultInit(uint32_t resultCode, uint32_t errorCode, bool imageFetched) generates (int32_t result); + + onResultTransfer(uint8_t type, string input) generates (int32_t result); + + onResultTransferImg(vec input) generates (int32_t result); + + oneway onResultFinish(); +}; diff --git a/interfaces/fingerprints/extension/1.0/ISensorTestCaptureCallback.hal b/interfaces/fingerprints/extension/1.0/ISensorTestCaptureCallback.hal new file mode 100644 index 0000000..9b4f841 --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/ISensorTestCaptureCallback.hal @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface ISensorTestCaptureCallback { + oneway onAcquired(uint32_t acquiredInfo); + + oneway onError(uint32_t error); +}; diff --git a/interfaces/fingerprints/extension/1.0/IVerifyUserCallback.hal b/interfaces/fingerprints/extension/1.0/IVerifyUserCallback.hal new file mode 100644 index 0000000..a4643ba --- /dev/null +++ b/interfaces/fingerprints/extension/1.0/IVerifyUserCallback.hal @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2023 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.fingerprints.extension@1.0; + +interface IVerifyUserCallback { + oneway onResult(uint32_t result, uint64_t userId, uint64_t userEntityId, vec encapsulatedResult); + + oneway onHelp(uint32_t helpCode); +};