From f401f30c14d3cf126a5e728a772889cd94fa406b Mon Sep 17 00:00:00 2001 From: dodyirawan85 <40514988+dodyirawan85@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:54:57 +0700 Subject: [PATCH] X6833B: Configure Sensors stack Refs: https://github.com/PQEnablers-Devices/android_device_xiaomi_ruby/commit/3bf7b31611ab1146f605371790d9499a70af4dd8 Co-authored-by: bengris32 Signed-off-by: dodyirawan85 <40514988+dodyirawan85@users.noreply.github.com> --- Android.mk | 6 ++++++ configs/properties/vendor.prop | 3 +++ configs/sensors/hals.conf | 1 + configs/vintf/manifest.xml | 10 ---------- device.mk | 12 ++++++++++++ proprietary-files.txt | 7 +++++++ 6 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 configs/sensors/hals.conf diff --git a/Android.mk b/Android.mk index 8668599..b4cf791 100644 --- a/Android.mk +++ b/Android.mk @@ -46,6 +46,11 @@ $(KEYMASTER_SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(hide) echo "Linking $@" @ln -sf $(subst default,trustonic,$(notdir $@)) $@ +SENSOR_SYMLINKS := $(TARGET_OUT_VENDOR)/lib64/hw/sensors.$(TARGET_BOARD_PLATFORM).so +$(SENSOR_SYMLINKS): $(LOCAL_INSTALLED_MODULE) + $(hide) echo "Linking $(notdir $@)" + @ln -sf sensors.mediatek.V2.0.so $@ + VENDOR_PLATFORM_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/, $(strip $(shell cat $(DEVICE_PATH)/symlink/vendor.txt))) $(VENDOR_PLATFORM_SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(hide) echo "Linking $(notdir $@)" @@ -56,6 +61,7 @@ ALL_DEFAULT_INSTALLED_MODULES += \ $(DISPLAY_SYMLINKS) \ $(GATEKEEPER_SYMLINKS) \ $(KEYMASTER_SYMLINKS) \ + $(SENSOR_SYMLINKS) \ $(VENDOR_PLATFORM_SYMLINKS) endif diff --git a/configs/properties/vendor.prop b/configs/properties/vendor.prop index 29058a1..b2c71ef 100644 --- a/configs/properties/vendor.prop +++ b/configs/properties/vendor.prop @@ -35,6 +35,9 @@ ro.hardware.gatekeeper=trustonic ro.crypto.volume.filenames_mode=aes-256-cts ro.hardware.kmsetkey=trustonic +# Sensors +ro.vendor.mtk.sensor.support=yes + # TEE ro.vendor.mtk_trustonic_tee_support=1 diff --git a/configs/sensors/hals.conf b/configs/sensors/hals.conf new file mode 100644 index 0000000..de5516c --- /dev/null +++ b/configs/sensors/hals.conf @@ -0,0 +1 @@ +android.hardware.sensors@2.X-subhal-mediatek.so diff --git a/configs/vintf/manifest.xml b/configs/vintf/manifest.xml index 8d4cb0e..0b7809e 100644 --- a/configs/vintf/manifest.xml +++ b/configs/vintf/manifest.xml @@ -216,16 +216,6 @@ @1.2::ISecureElement/SIM1 @1.2::ISecureElement/SIM2 - - android.hardware.sensors - hwbinder - 2.0 - - ISensors - default - - @2.0::ISensors/default - android.hardware.soundtrigger hwbinder diff --git a/device.mk b/device.mk index 48c32ab..d9c1e87 100644 --- a/device.mk +++ b/device.mk @@ -171,6 +171,18 @@ PRODUCT_COPY_FILES += \ # Project ID Quota $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) +# Sensors +PRODUCT_PACKAGES += \ + libsensorndkbridge \ + android.hardware.sensors@1.0.vendor \ + android.hardware.sensors@2.1.vendor \ + android.frameworks.sensorservice@1.0.vendor \ + android.hardware.sensors@2.1-service.multihal \ + android.hardware.sensors@2.0-ScopedWakelock.vendor + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf + # Shipping API level PRODUCT_SHIPPING_API_LEVEL := 31 diff --git a/proprietary-files.txt b/proprietary-files.txt index 6c70cde..bb8f39f 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -486,6 +486,13 @@ vendor/lib64/libpowerhalwrap_vendor.so vendor/lib64/libtranlog.so vendor/lib64/vendor.mediatek.hardware.power@2.0.so +# Sensors +vendor/lib64/hw/android.hardware.sensors@2.X-subhal-mediatek.so +vendor/lib64/hw/sensors.mediatek.V2.0.so +vendor/lib64/libhfmanager.so +vendor/lib64/libhwm.so +vendor/lib64/libksensor.so + # TEE vendor/app/mcRegistry/020f0000000000000000000000000000.drbin vendor/app/mcRegistry/020f0000000000000000000000000000.tlbin