From 3d02f7a4937be7f3756c81e84356002f7e427fbf Mon Sep 17 00:00:00 2001 From: rtd1250 <47224354+rtd1250@users.noreply.github.com> Date: Sat, 18 Jun 2022 22:02:20 +0200 Subject: [PATCH] Switch to Samsung sensors service @2.1 Fixes proximity sensors, with a kernel patch: https://github.com/rtd1250/android_kernel_samsung_sm6150/commit/cc3172865f31721109c07e4ab91aacdb9a961782 --- device.mk | 3 ++- proprietary-files.txt | 2 -- rootdir/bin/init.qcom.sensors.sh | 23 +++-------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/device.mk b/device.mk index b6b6dc8..3607161 100755 --- a/device.mk +++ b/device.mk @@ -383,7 +383,8 @@ PRODUCT_COPY_FILES += \ # Sensors PRODUCT_PACKAGES += \ - android.hardware.sensors@2.0-service.multihal + android.hardware.sensors@2.1-service.samsung-multihal \ + android.hardware.sensors@2.0-ScopedWakelock.vendor # Sensor Configuration PRODUCT_COPY_FILES += \ diff --git a/proprietary-files.txt b/proprietary-files.txt index 693b322..d70943a 100755 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1219,9 +1219,7 @@ vendor/lib/libsecnativefeature.so vendor/lib64/libsecnativefeature.so # Sensors -vendor/bin/hw/android.hardware.sensors@2.0-service.multihal vendor/bin/factory.ssc -vendor/etc/init/android.hardware.sensors@2.0-service-multihal.rc vendor/etc/sensors/config/default_sensors.json vendor/etc/sensors/config/lsm6dsm_0.json vendor/etc/sensors/config/sns_amd.json diff --git a/rootdir/bin/init.qcom.sensors.sh b/rootdir/bin/init.qcom.sensors.sh index 74fe59f..dcc0556 100644 --- a/rootdir/bin/init.qcom.sensors.sh +++ b/rootdir/bin/init.qcom.sensors.sh @@ -1,5 +1,5 @@ #!/vendor/bin/sh -# Copyright (c) 2015,2018 The Linux Foundation. All rights reserved. +# Copyright (c) 2020 The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -29,22 +29,5 @@ # # Function to start sensors for SSC enabled platforms # -start_sensors() -{ - sscrpcd_status=`getprop init.svc.vendor.sensors` - - chmod -h 775 /mnt/vendor/persist/sensors - chmod -h 664 /mnt/vendor/persist/sensors/sensors_settings - mkdir -p /mnt/vendor/persist/sensors/registry/registry - chown -h -R system.system /mnt/vendor/persist/sensors - - start vendor.sensors.qti - start factory_ssc - - # Only for SLPI - if [ -c /dev/msm_dsps -o -c /dev/sensors ] && [ -z "$sscrpcd_status" ]; then - start vendor.sensors - fi -} - -start_sensors +cp /vendor/etc/sensors/scripts/* /data/vendor/sensors/scripts/ +chmod a+rw /data/vendor/sensors/scripts/*