From 1e86d239bcbb32e060e413d0cd1ddecaef037284 Mon Sep 17 00:00:00 2001 From: SagarMakhar Date: Fri, 4 Oct 2019 16:16:16 +0000 Subject: [PATCH] sdm710-common: Import oppo fingerprint hal Signed-off-by: SagarMakhar --- interfaces/vendor/Android.bp | 4 + .../biometrics/fingerprint/2.1/Android.bp | 16 +++ .../2.1/IBiometricsFingerprint.hal | 73 +++++++++++++ .../IBiometricsFingerprintClientCallback.hal | 44 ++++++++ .../biometrics/fingerprint/2.1/types.hal | 103 ++++++++++++++++++ interfaces/vendor/update-makefiles.sh | 6 + 6 files changed, 246 insertions(+) create mode 100644 interfaces/vendor/Android.bp create mode 100644 interfaces/vendor/hardware/biometrics/fingerprint/2.1/Android.bp create mode 100644 interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal create mode 100644 interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal create mode 100644 interfaces/vendor/hardware/biometrics/fingerprint/2.1/types.hal create mode 100644 interfaces/vendor/update-makefiles.sh diff --git a/interfaces/vendor/Android.bp b/interfaces/vendor/Android.bp new file mode 100644 index 0000000..f58f690 --- /dev/null +++ b/interfaces/vendor/Android.bp @@ -0,0 +1,4 @@ +hidl_package_root { + name: "vendor.oppo", + path: "device/realme/sdm710-common/interfaces/vendor", +} diff --git a/interfaces/vendor/hardware/biometrics/fingerprint/2.1/Android.bp b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/Android.bp new file mode 100644 index 0000000..ecd5483 --- /dev/null +++ b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/Android.bp @@ -0,0 +1,16 @@ +// This file is autogenerated by hidl-gen -Landroidbp. + +hidl_interface { + name: "vendor.oppo.hardware.biometrics.fingerprint@2.1", + root: "vendor.oppo", + srcs: [ + "IBiometricsFingerprint.hal", + "IBiometricsFingerprintClientCallback.hal", + "types.hal", + ], + interfaces: [ + "android.hidl.base@1.0", + ], + gen_java: true, +} + diff --git a/interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal new file mode 100644 index 0000000..2e8a35b --- /dev/null +++ b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2017 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 vendor.oppo.hardware.biometrics.fingerprint@2.1; + +import IBiometricsFingerprintClientCallback; + +interface IBiometricsFingerprint { + + setNotify(IBiometricsFingerprintClientCallback clientCallback) generates (uint64_t deviceId); + + preEnroll() generates (uint64_t authChallenge); + + enroll(uint8_t[69] hat, uint32_t gid, uint32_t timeoutSec) generates (RequestStatus debugErrno); + + postEnroll() generates (RequestStatus debugErrno); + + getAuthenticatorId() generates (uint64_t AuthenticatorId); + + cancel() generates (RequestStatus debugErrno); + + enumerate() generates (RequestStatus debugErrno); + + remove(uint32_t gid, uint32_t fid) generates (RequestStatus debugErrno); + + setActiveGroup(uint32_t gid, string storePath) generates (RequestStatus debugErrno); + + authenticate(uint64_t operationId, uint32_t gid) generates (RequestStatus debugErrno); + + pauseEnroll() generates (RequestStatus debugErrno); + + pauseIdentify() generates (RequestStatus debugErrno); + + continueEnroll() generates (RequestStatus debugErrno); + + setScreenState(FingerprintScreenState ScreenState); + + getAlikeyStatus() generates (RequestStatus debugErrno); + + continueIdentify() generates (RequestStatus debugErrno); + + authenticateAsType(uint64_t auth, uint32_t type, FingerprintAuthType AuthType) generates (RequestStatus debugErrno); + + getEngineeringInfo(uint32_t info) generates (RequestStatus debugErrno); + + sendFingerprintCmd(int32_t cmd, vec CmdId) generates (RequestStatus debugErrno); + + dynamicallyConfigLog(uint32_t log) generates (RequestStatus debugErrno); + + setTouchEventListener() generates (RequestStatus debugErrno); + + getEnrollmentTotalTimes() generates (RequestStatus debugErrno); + + cleanUp() generates (RequestStatus debugErrno); + + touchUp() generates (RequestStatus debugErrno); + + touchDown() generates (RequestStatus debugErrno); + +}; diff --git a/interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal new file mode 100644 index 0000000..b778a28 --- /dev/null +++ b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017 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 vendor.oppo.hardware.biometrics.fingerprint@2.1; + +/* This HAL interface communicates asynchronous results from the + fingerprint driver in response to user actions on the fingerprint sensor +*/ +interface IBiometricsFingerprintClientCallback { + + oneway onEnrollResult(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining); + + oneway onAcquired(uint64_t deviceId, FingerprintAcquiredInfo acquiredInfo, int32_t vendorCode); + + oneway onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, vec token); + + oneway onError(uint64_t deviceId, FingerprintError error, int32_t vendorCode); + + oneway onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining); + + oneway onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining); + + oneway onTouchUp(uint64_t deviceId); + oneway onTouchDown(uint64_t deviceId); + oneway onSyncTemplates(uint64_t deviceId, vec fingerId, uint32_t remaining); + oneway onFingerprintCmd(int32_t deviceId, vec groupId, uint32_t remaining); + oneway onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score); + oneway onMonitorEventTriggered(uint32_t type, string data); + oneway onEngineeringInfoUpdated(uint32_t length, vec keys, vec values); + +}; diff --git a/interfaces/vendor/hardware/biometrics/fingerprint/2.1/types.hal b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/types.hal new file mode 100644 index 0000000..cbf0a22 --- /dev/null +++ b/interfaces/vendor/hardware/biometrics/fingerprint/2.1/types.hal @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2017 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 vendor.oppo.hardware.biometrics.fingerprint@2.1; + +enum RequestStatus : int32_t { + SYS_UNKNOWN = 1, + SYS_OK = 0, + SYS_ENOENT = -2, + SYS_EINTR = -4, + SYS_EIO = -5, + SYS_EAGAIN = -11, + SYS_ENOMEM = -12, + SYS_EACCES = -13, + SYS_EFAULT = -14, + SYS_EBUSY = -16, + SYS_EINVAL = -22, + SYS_ENOSPC = -28, + SYS_ETIMEDOUT = -110, +}; + +enum FingerprintError : int32_t { + ERROR_NO_ERROR = 0, + ERROR_HW_UNAVAILABLE = 1, + ERROR_UNABLE_TO_PROCESS = 2, + ERROR_TIMEOUT = 3, + ERROR_NO_SPACE = 4, + ERROR_CANCELED = 5, + ERROR_UNABLE_TO_REMOVE = 6, + ERROR_LOCKOUT = 7, + ERROR_VENDOR = 8 +}; + +enum FingerprintAcquiredInfo : int32_t { + ACQUIRED_GOOD = 0, + ACQUIRED_PARTIAL = 1, + ACQUIRED_INSUFFICIENT = 2, + ACQUIRED_IMAGER_DIRTY = 3, + ACQUIRED_TOO_SLOW = 4, + ACQUIRED_TOO_FAST = 5, + ACQUIRED_VENDOR = 6 +}; + +struct FingerprintFingerId { + uint32_t gid; + uint32_t fid; +}; + +struct FingerprintEnroll { + FingerprintFingerId finger; + uint32_t samplesRemaining; uint64_t msg; +}; + +struct FingerprintIterator { + FingerprintFingerId finger; + uint32_t remainingTemplates; +}; + +typedef FingerprintIterator FingerprintEnumerated; +typedef FingerprintIterator FingerprintRemoved; + +struct FingerprintAcquired { + FingerprintAcquiredInfo acquiredInfo; +}; + +struct FingerprintAuthenticated { + FingerprintFingerId finger; + uint8_t[69] hat; +}; + +enum FingerprintMsgType : int32_t { + ERROR = -1, + ACQUIRED = 1, + TEMPLATE_ENROLLING = 3, + TEMPLATE_REMOVED = 4, + AUTHENTICATED = 5, + TEMPLATE_ENUMERATING = 6, +}; + +enum FingerprintScreenState : int32_t { + FINGERPRINT_SCREEN_OFF = 0, + FINGERPRINT_SCREEN_ON = 1, +}; + +enum FingerprintAuthType : int32_t { + TYPE_KEYGUARD = 1, + TYPE_PAY = 2, + TYPE_OTHER = 3, +}; + diff --git a/interfaces/vendor/update-makefiles.sh b/interfaces/vendor/update-makefiles.sh new file mode 100644 index 0000000..a6414b3 --- /dev/null +++ b/interfaces/vendor/update-makefiles.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +source $ANDROID_BUILD_TOP/system/tools/hidl/update-makefiles-helper.sh + +do_makefiles_update \ + "vendor.oppo:device/realme/sdm710-common/interfaces/vendor"