From 2d6f07b00c3753e35b4cd8ae557478d443f99314 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Mon, 13 Nov 2023 13:48:00 +0000 Subject: [PATCH] sm8450-common: Move to QTI health AIDL service The health AIDL HAL service provides functionalities of charger, therefore system charger at /system/bin/charger is deprecated. On top of that, QTI health AIDL HAL service enables suspend by default, the equivalent of setting ro.charger.enable_suspend for legacy charger. Change-Id: I59c23e7974cea1174b0161f31a535fa3afa1e5c9 --- common.mk | 2 +- extract-files.sh | 3 +++ properties/system.prop | 3 --- rootdir/etc/init.qcom.rc | 9 +-------- rootdir/etc/init.target.rc | 2 +- rootdir/etc/init.xiaomi_sm8450.rc | 2 +- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/common.mk b/common.mk index 3dfe1fc..4c8ef68 100644 --- a/common.mk +++ b/common.mk @@ -226,7 +226,7 @@ PRODUCT_COPY_FILES += \ # Health PRODUCT_PACKAGES += \ - android.hardware.health@2.1-service + android.hardware.health-service.qti # HIDL PRODUCT_PACKAGES += \ diff --git a/extract-files.sh b/extract-files.sh index f16e036..92b0be9 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -60,6 +60,9 @@ fi function blob_fixup() { case "${1}" in + vendor/etc/init/hw/init.mi_thermald.rc|vendor/etc/init/hw/init.qcom.usb.rc|vendor/etc/init/hw/init.qti.kernel.rc) + sed -i 's/on charger/on property:init.svc.vendor.charger=running/g' "${2}" + ;; vendor/etc/init/init.embmssl_server.rc) sed -i -n '/interface/!p' "${2}" ;; diff --git a/properties/system.prop b/properties/system.prop index 5793470..66e3f86 100644 --- a/properties/system.prop +++ b/properties/system.prop @@ -1,6 +1,3 @@ -# Charger -ro.charger.enable_suspend=1 - # CNE persist.vendor.cne.feature=1 diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 879d707..3bd5c57 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -725,13 +725,6 @@ service profiler_daemon /system/bin/profiler_daemon group root disabled -service charger /system/bin/charger - class charger - user system - group system graphics input - capabilities SYS_BOOT - seclabel u:r:charger:s0 - service vendor.ssr_diag /system/vendor/bin/ssr_diag class late_start user system @@ -810,7 +803,7 @@ service esepmdaemon /system/vendor/bin/esepmdaemon user system group nfc -on charger +on property:init.svc.vendor.charger=running setprop persist.sys.usb.config mass_storage start qcom-post-boot diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 345759f..cee483a 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -139,7 +139,7 @@ on init && property:ro.boot.mode=charger wait /sys/kernel/boot_adsp/boot write /sys/kernel/boot_adsp/boot 1 -on charger +on property:init.svc.vendor.charger=running start vendor.power_off_alarm setprop sys.usb.controller a600000.dwc3 wait /sys/class/udc/${sys.usb.controller} diff --git a/rootdir/etc/init.xiaomi_sm8450.rc b/rootdir/etc/init.xiaomi_sm8450.rc index 8742c3c..92a9209 100644 --- a/rootdir/etc/init.xiaomi_sm8450.rc +++ b/rootdir/etc/init.xiaomi_sm8450.rc @@ -155,7 +155,7 @@ on property:sys.boot_completed=1 # Set thermal mode to mgame write /sys/devices/virtual/thermal/thermal_message/sconfig 20 -on charger +on property:init.svc.vendor.charger=running chown system system /sys/class/backlight/panel0-backlight/brightness chown system system /sys/class/backlight/panel1-backlight/brightness