From 565809d0b525f9c5a68e7384f938eb21dcb7a7ef Mon Sep 17 00:00:00 2001 From: Arian Date: Wed, 13 Oct 2021 00:06:30 +0200 Subject: [PATCH] Revert "sm6150-common: fingerprint: Allow to build without fingerprintextension" This reverts commit a8c139109153adffa4eca514607c5ba421705491. Change-Id: I78244b2491b8ba824907cf1cb056c2f26bffbc72 --- configs/hidl/manifest.xml | 10 ++++++++ fingerprint/Android.bp | 25 ++++--------------- fingerprint/BiometricsFingerprint.cpp | 2 -- fingerprint/BiometricsFingerprint.h | 13 ++-------- ...ngerprint@2.1-service.xiaomi_sm6150-ext.rc | 7 ------ fingerprint/service.cpp | 2 -- ...aomi.hardware.fingerprintextension@1.0.xml | 11 -------- sepolicy/vendor/file_contexts | 1 - sm6150.mk | 3 +++ 9 files changed, 20 insertions(+), 54 deletions(-) delete mode 100644 fingerprint/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext.rc delete mode 100644 fingerprint/vendor.xiaomi.hardware.fingerprintextension@1.0.xml diff --git a/configs/hidl/manifest.xml b/configs/hidl/manifest.xml index ce90b6e..ce4af6e 100644 --- a/configs/hidl/manifest.xml +++ b/configs/hidl/manifest.xml @@ -417,4 +417,14 @@ imsrtpservice + + vendor.xiaomi.hardware.fingerprintextension + hwbinder + 1.0 + + IXiaomiFingerprint + default + + @1.0::IXiaomiFingerprint/default + diff --git a/fingerprint/Android.bp b/fingerprint/Android.bp index 4347fc7..90bbe7e 100644 --- a/fingerprint/Android.bp +++ b/fingerprint/Android.bp @@ -1,6 +1,8 @@ -cc_defaults { - name: "xiaomi_sm6150_fingerprint_defaults", +cc_binary { + name: "android.hardware.biometrics.fingerprint@2.1-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"], vendor: true, relative_install_path: "hw", srcs: [ @@ -15,24 +17,7 @@ cc_defaults { "libhardware", "libutils", "android.hardware.biometrics.fingerprint@2.1", + "vendor.xiaomi.hardware.fingerprintextension@1.0", ], -} -cc_binary { - name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150", - defaults: ["xiaomi_sm6150_fingerprint_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"], -} - -cc_binary { - name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext", - defaults: ["xiaomi_sm6150_fingerprint_defaults"], - init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext.rc"], - vintf_fragments: [ - "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150.xml", - "vendor.xiaomi.hardware.fingerprintextension@1.0.xml", - ], - shared_libs: ["vendor.xiaomi.hardware.fingerprintextension@1.0"], - cflags: ["-DXIAOMI_FINGERPRINTEXTENSION"], } diff --git a/fingerprint/BiometricsFingerprint.cpp b/fingerprint/BiometricsFingerprint.cpp index d902b42..318e8b2 100644 --- a/fingerprint/BiometricsFingerprint.cpp +++ b/fingerprint/BiometricsFingerprint.cpp @@ -378,11 +378,9 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t *msg) { } } -#ifdef XIAOMI_FINGERPRINTEXTENSION Return BiometricsFingerprint::extCmd(int32_t cmd, int32_t param) { return mDevice->extCmd(mDevice, cmd, param); } -#endif /* XIAOMI_FINGERPRINTEXTENSION */ } // namespace implementation } // namespace V2_1 diff --git a/fingerprint/BiometricsFingerprint.h b/fingerprint/BiometricsFingerprint.h index 1d4fadb..b5bf399 100644 --- a/fingerprint/BiometricsFingerprint.h +++ b/fingerprint/BiometricsFingerprint.h @@ -24,13 +24,9 @@ #include #include #include - -#ifdef XIAOMI_FINGERPRINTEXTENSION #include + #include "fingerprint.h" -#else -#include -#endif namespace android { namespace hardware { @@ -48,12 +44,9 @@ using ::android::hardware::hidl_vec; using ::android::hardware::hidl_string; using ::android::sp; -#ifdef XIAOMI_FINGERPRINTEXTENSION using ::vendor::xiaomi::hardware::fingerprintextension::V1_0::IXiaomiFingerprint; + struct BiometricsFingerprint : public IBiometricsFingerprint, public IXiaomiFingerprint { -#else -struct BiometricsFingerprint : public IBiometricsFingerprint { -#endif public: BiometricsFingerprint(); ~BiometricsFingerprint(); @@ -74,9 +67,7 @@ public: Return remove(uint32_t gid, uint32_t fid) override; Return setActiveGroup(uint32_t gid, const hidl_string& storePath) override; Return authenticate(uint64_t operationId, uint32_t gid) override; -#ifdef XIAOMI_FINGERPRINTEXTENSION Return extCmd(int32_t cmd, int32_t param) override; -#endif /*XIAOMI_FINGERPRINTEXTENSION */ private: static fingerprint_device_t* openHal(); diff --git a/fingerprint/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext.rc b/fingerprint/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext.rc deleted file mode 100644 index b77fb05..0000000 --- a/fingerprint/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext.rc +++ /dev/null @@ -1,7 +0,0 @@ -service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150-ext - # "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. - class late_start - user system - group system input uhid diff --git a/fingerprint/service.cpp b/fingerprint/service.cpp index 9f4c8d6..760d101 100644 --- a/fingerprint/service.cpp +++ b/fingerprint/service.cpp @@ -43,7 +43,6 @@ status_t BiometricsFingerprint::registerAsSystemService() { ALOGI("Successfully registered IBiometricsFingerprint"); } -#ifdef XIAOMI_FINGERPRINTEXTENSION ret = IXiaomiFingerprint::registerAsService(); if (ret != 0) { ALOGE("Failed to register IXiaomiFingerprint (%d)", ret); @@ -51,7 +50,6 @@ status_t BiometricsFingerprint::registerAsSystemService() { } else { ALOGI("Successfully registered IXiaomiFingerprint"); } -#endif /* XIAOMI_FINGERPRINTEXTENSION */ fail: return ret; diff --git a/fingerprint/vendor.xiaomi.hardware.fingerprintextension@1.0.xml b/fingerprint/vendor.xiaomi.hardware.fingerprintextension@1.0.xml deleted file mode 100644 index 9f93e0a..0000000 --- a/fingerprint/vendor.xiaomi.hardware.fingerprintextension@1.0.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - vendor.xiaomi.hardware.fingerprintextension - hwbinder - 1.0 - - IXiaomiFingerprint - default - - - diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index d1b9d46..b5637a4 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -23,7 +23,6 @@ # 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\.1-service\.xiaomi_sm6150-ext 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 diff --git a/sm6150.mk b/sm6150.mk index 5f97571..0bc188d 100644 --- a/sm6150.mk +++ b/sm6150.mk @@ -140,6 +140,9 @@ PRODUCT_PACKAGES += \ android.hardware.drm@1.4-service.clearkey # Fingerprint +PRODUCT_PACKAGES += \ + android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sm6150 + PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml