a32: Switch to OSS AIDL Sensors multihal

F DEBUG   : Abort message: 'incStrongRequireStrong() called on 0xb400007d63ac3520 which isn't already owned'

avc:  denied  { call } for  scontext=u:r:hal_sensors_default:s0 tcontext=u:r:system_server:s0 tclass=binder permissive=0

E android.hardware.sensors-service.samsung-multihal: associateClass: Expecting binder to have class 'android.hardware.sensors.ISensorsCallback' but descriptor is actually ''.
This commit is contained in:
AndroidHQ254 2024-05-14 21:02:07 +03:00
commit db9e28f788
No known key found for this signature in database
GPG key ID: 48008337615EE8A9
6 changed files with 19 additions and 10 deletions

View file

@ -55,6 +55,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.sensors</name>
<version>1</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.vibrator</name>
<version>2</version>

View file

@ -369,11 +369,12 @@ PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(LOCAL_PATH)/configs/seccomp_policy,$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy)
# Sensors
PRODUCT_PACKAGES += \
android.hardware.sensors-service.samsung-multihal
PRODUCT_PACKAGES += \
android.frameworks.sensorservice@1.0.vendor \
android.hardware.sensors@1.0.vendor \
android.hardware.sensors@2.0-ScopedWakelock.vendor \
android.hardware.sensors@2.1.vendor
android.hardware.sensors@1.0.vendor
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf
@ -386,7 +387,8 @@ PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH) \
hardware/google/interfaces \
hardware/google/pixel \
hardware/mediatek
hardware/mediatek \
hardware/samsung_ext
# Thermal
PRODUCT_PACKAGES += \

View file

@ -58,10 +58,6 @@ function blob_fixup {
vendor/bin/hw/android.hardware.media.c2@1.2-mediatek|vendor/bin/hw/android.hardware.media.c2@1.2-mediatek-64b)
"${PATCHELF}" --add-needed "libstagefright_foundation-v33.so" "${2}"
;;
vendor/bin/hw/android.hardware.sensors@2.0-service.multihal)
"$PATCHELF" --replace-needed libhidlbase.so libhidlbase-v31.so "${2}"
"$PATCHELF" --replace-needed libutils.so libutils-v32.so "$2"
;;
vendor/bin/hw/android.hardware.wifi@1.0-service-lazy)
"$PATCHELF" --replace-needed "libwifi-hal.so" "libwifi-hal-mtk.so" "${2}"
;;
@ -73,6 +69,9 @@ function blob_fixup {
vendor/bin/hw/vendor.samsung.hardware.hyper-service)
"$PATCHELF" --replace-needed liblog.so liblog-v31.so "${2}"
;;
vendor/lib*/sensors.inputvirtual.so|vendor/lib*/sensors.sensorhub.so)
"$PATCHELF" --replace-needed libutils.so libutils-v31.so "$2"
;;
vendor/lib64/libwifi-hal-mtk.so)
"$PATCHELF" --set-soname libwifi-hal-mtk.so "${2}"
;;

View file

@ -1473,8 +1473,6 @@ vendor/lib64/libfloatingfeature.so
vendor/lib64/libsecnativefeature.so
# Sensors
vendor/bin/hw/android.hardware.sensors@2.0-service.multihal
vendor/etc/init/android.hardware.sensors@2.0-service-multihal.rc
vendor/lib/librgbwlightsensor.so
vendor/lib/libsensorndkbridge.so
vendor/lib/sensors.grip.so

View file

@ -69,6 +69,7 @@
# Sensors
/dev/shub_data_injection u:object_r:shub_device:s0
/dev/shub_sensorhub u:object_r:shub_device:s0
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors-service\.samsung-multihal u:object_r:hal_sensors_default_exec:s0
# Snap
/(vendor|system/vendor)/bin/snap_utility_64 u:object_r:snap_utility_exec:s0

View file

@ -11,6 +11,7 @@ allow hal_sensors_default iio_device:chr_file r_file_perms;
allow hal_sensors_default sysfs_ss_writable:dir r_dir_perms;
allow hal_sensors_default sysfs_ss_writable:file rw_file_perms;
allow hal_sensors_default sysfs_ski_display_writable:file r_file_perms;
allow hal_sensors_default system_server:binder call;
r_dir_file(hal_sensors_default, sysfs_iio_devices)