From cb60895bb0be16100aa652b7c7df6d758decd39c Mon Sep 17 00:00:00 2001 From: Woomymy Date: Thu, 25 Jul 2024 23:23:11 +0800 Subject: [PATCH] =?UTF-8?q?LG8n:=20Add=20a=20shim=20to=20link=20sensor=20b?= =?UTF-8?q?lobs=20against=20`android.hardware.sens=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ors@1.0-convert` * `libndksensorbridge` was converted to AIDL and is no longer linked to this static library that contains symbols required by our sensor blobs. Add a shim linked to `android.hardware.sensors@1.0-convert` to fix our sensors Change-Id: I969f97bb15d0abcc71f87352722995db3826e122 Signed-off-by: Woomymy Signed-off-by: Shirayuki39 --- device.mk | 4 ++++ extract-files.sh | 6 ++++++ shims/Android.bp | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 shims/Android.bp diff --git a/device.mk b/device.mk index 9b3ba0a..bb27877 100644 --- a/device.mk +++ b/device.mk @@ -253,6 +253,10 @@ PRODUCT_PACKAGES += \ android.hardware.security.sharedsecret-V1-ndk_platform.vendor \ libcppbor_external.vendor:64 +# Libshims +PRODUCT_PACKAGES += \ + libshim_sensors + # Lights PRODUCT_PACKAGES += \ android.hardware.light-V1-ndk.vendor diff --git a/extract-files.sh b/extract-files.sh index 58d16c8..7e205c8 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -111,6 +111,12 @@ function blob_fixup { "$PATCHELF" --replace-needed "android.hardware.security.secureclock-V1-ndk_platform.so" "android.hardware.security.secureclock-V1-ndk.so" "$2" "$PATCHELF" --replace-needed "android.hardware.security.sharedsecret-V1-ndk_platform.so" "android.hardware.security.sharedsecret-V1-ndk.so" "$2" ;; + vendor/lib64/hw/android.hardware.sensors@2.X-subhal-mediatek.so|\ + vendor/lib64/hw/mt6789/vendor.mediatek.hardware.pq@2.15-impl.so|\ + vendor/lib64/mt6789/libaalservice.so|\ + vendor/lib64/mt6789/libcam.utils.sensorprovider.so) + "${PATCHELF}" --add-needed "libshim_sensors.so" "${2}" + ;; esac } diff --git a/shims/Android.bp b/shims/Android.bp new file mode 100644 index 0000000..d69dfd5 --- /dev/null +++ b/shims/Android.bp @@ -0,0 +1,12 @@ +cc_library_shared { + name: "libshim_sensors", + whole_static_libs: [ + "android.hardware.sensors@1.0-convert" + ], + shared_libs: [ + "libhardware", + "libhidlbase", + "android.hardware.sensors@1.0" + ], + vendor: true +}