sm6150-common: fingerprint: Uprev to 2.3 HAL
Change-Id: I56ea1646ef464f7e533add5a0017620e21db686d
This commit is contained in:
parent
e8054c433c
commit
a54d369435
@ -1,8 +1,8 @@
|
||||
cc_binary {
|
||||
name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150",
|
||||
name: "android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150",
|
||||
defaults: ["hidl_defaults"],
|
||||
init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150.rc"],
|
||||
vintf_fragments: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150.xml"],
|
||||
init_rc: ["android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150.rc"],
|
||||
vintf_fragments: ["android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150.xml"],
|
||||
vendor: true,
|
||||
relative_install_path: "hw",
|
||||
srcs: [
|
||||
@ -17,6 +17,8 @@ cc_binary {
|
||||
"libhardware",
|
||||
"libutils",
|
||||
"android.hardware.biometrics.fingerprint@2.1",
|
||||
"android.hardware.biometrics.fingerprint@2.2",
|
||||
"android.hardware.biometrics.fingerprint@2.3",
|
||||
],
|
||||
|
||||
}
|
||||
|
@ -14,8 +14,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150"
|
||||
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150"
|
||||
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150"
|
||||
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150"
|
||||
|
||||
#include <log/log.h>
|
||||
|
||||
@ -25,14 +25,12 @@ namespace android {
|
||||
namespace hardware {
|
||||
namespace biometrics {
|
||||
namespace fingerprint {
|
||||
namespace V2_1 {
|
||||
namespace V2_3 {
|
||||
namespace implementation {
|
||||
|
||||
// Supported fingerprint HAL version
|
||||
static const uint16_t kVersion = HARDWARE_MODULE_API_VERSION(2, 1);
|
||||
|
||||
using RequestStatus = android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
|
||||
|
||||
BiometricsFingerprint* BiometricsFingerprint::sInstance = nullptr;
|
||||
|
||||
BiometricsFingerprint::BiometricsFingerprint() : mClientCallback(nullptr), mDevice(nullptr) {
|
||||
@ -371,8 +369,56 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t* msg) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the fingerprint sensor is an under-display fingerprint
|
||||
* sensor.
|
||||
* @param sensorId the unique sensor ID for which the operation should be
|
||||
* performed.
|
||||
* @return isUdfps indicating whether the specified sensor is an
|
||||
* under-display fingerprint sensor.
|
||||
*/
|
||||
Return<bool> BiometricsFingerprint::isUdfps(uint32_t /* sensorId */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies about a touch occurring within the under-display fingerprint
|
||||
* sensor area.
|
||||
*
|
||||
* It it assumed that the device can only have one active under-display
|
||||
* fingerprint sensor at a time.
|
||||
*
|
||||
* If multiple fingers are detected within the sensor area, only the
|
||||
* chronologically first event will be reported.
|
||||
*
|
||||
* @param x The screen x-coordinate of the center of the touch contact area, in
|
||||
* display pixels.
|
||||
* @param y The screen y-coordinate of the center of the touch contact area, in
|
||||
* display pixels.
|
||||
* @param minor The length of the minor axis of an ellipse that describes the
|
||||
* touch area, in display pixels.
|
||||
* @param major The length of the major axis of an ellipse that describes the
|
||||
* touch area, in display pixels.
|
||||
*/
|
||||
Return<void> BiometricsFingerprint::onFingerDown(uint32_t /* x */, uint32_t /* y */,
|
||||
float /* minor */, float /* major */) {
|
||||
return Void();
|
||||
}
|
||||
/**
|
||||
* Notifies about a finger leaving the under-display fingerprint sensor area.
|
||||
*
|
||||
* It it assumed that the device can only have one active under-display
|
||||
* fingerprint sensor at a time.
|
||||
*
|
||||
* If multiple fingers have left the sensor area, only the finger which
|
||||
* previously caused a "finger down" event will be reported.
|
||||
*/
|
||||
Return<void> BiometricsFingerprint::onFingerUp() {
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace V2_3
|
||||
} // namespace fingerprint
|
||||
} // namespace biometrics
|
||||
} // namespace hardware
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
* Copyright (C) 2021 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.
|
||||
@ -14,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
|
||||
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
|
||||
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
|
||||
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
|
||||
|
||||
#include <hardware/fingerprint.h>
|
||||
|
||||
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
|
||||
#include <android/hardware/biometrics/fingerprint/2.3/IBiometricsFingerprint.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace biometrics {
|
||||
namespace fingerprint {
|
||||
namespace V2_1 {
|
||||
namespace V2_3 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
@ -33,9 +34,11 @@ using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
|
||||
using ::android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo;
|
||||
using ::android::hardware::biometrics::fingerprint::V2_1::FingerprintError;
|
||||
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
|
||||
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
|
||||
using ::android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
|
||||
|
||||
struct BiometricsFingerprint : public IBiometricsFingerprint {
|
||||
public:
|
||||
@ -59,6 +62,9 @@ struct BiometricsFingerprint : public IBiometricsFingerprint {
|
||||
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
|
||||
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
|
||||
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
|
||||
Return<bool> isUdfps(uint32_t sensorId) override;
|
||||
Return<void> onFingerDown(uint32_t x, uint32_t y, float minor, float major) override;
|
||||
Return<void> onFingerUp() override;
|
||||
|
||||
private:
|
||||
static fingerprint_device_t* openHal();
|
||||
@ -75,10 +81,10 @@ struct BiometricsFingerprint : public IBiometricsFingerprint {
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace V2_3
|
||||
} // namespace fingerprint
|
||||
} // namespace biometrics
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
|
||||
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
|
||||
|
@ -9,7 +9,7 @@ on post-fs-data
|
||||
mkdir /data/vendor/fpc 0770 system system
|
||||
mkdir /data/vendor/goodix 0770 system system
|
||||
|
||||
service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150
|
||||
service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150
|
||||
# "class hal" causes a race condition on some devices due to files created
|
||||
# in /data. As a workaround, postpone startup until later in boot once
|
||||
# /data is mounted.
|
@ -2,7 +2,7 @@
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.biometrics.fingerprint</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<version>2.3</version>
|
||||
<interface>
|
||||
<name>IBiometricsFingerprint</name>
|
||||
<instance>default</instance>
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
* Copyright (C) 2021 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.
|
||||
@ -14,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150"
|
||||
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.3-service.xiaomi_sm6150"
|
||||
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
|
||||
@ -23,8 +24,8 @@
|
||||
using android::sp;
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
|
||||
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
|
||||
using android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
|
||||
using android::hardware::biometrics::fingerprint::V2_3::implementation::BiometricsFingerprint;
|
||||
|
||||
int main() {
|
||||
android::sp<IBiometricsFingerprint> bio = BiometricsFingerprint::getInstance();
|
||||
|
2
sepolicy/vendor/file_contexts
vendored
2
sepolicy/vendor/file_contexts
vendored
@ -22,7 +22,7 @@
|
||||
/data/vendor/goodix(/.*)? u:object_r:fingerprint_data_file:s0
|
||||
|
||||
# HALs
|
||||
/(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.xiaomi_sm6150 u:object_r:hal_fingerprint_default_exec:s0
|
||||
/(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.xiaomi_sm6150 u:object_r:hal_fingerprint_default_exec:s0
|
||||
/vendor/bin/hw/android\.hardware\.light@2\.0-service\.xiaomi_sm6150 u:object_r:hal_light_default_exec:s0
|
||||
/vendor/bin/hw/android\.hardware\.power-service\.xiaomi-libperfmgr u:object_r:hal_power_default_exec:s0
|
||||
/vendor/bin/hw/vendor\.lineage\.livedisplay@2\.1-service\.xiaomi_sm6150 u:object_r:hal_lineage_livedisplay_qti_exec:s0
|
||||
|
Loading…
Reference in New Issue
Block a user