From 55bc3d36ea9168ad698c068a22014634ab77db50 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Fri, 3 Mar 2023 23:43:42 +0200 Subject: [PATCH] sm7125-common: Build Lineage Health HAL Change-Id: I70cc903a03ac9fa3303bb8fa039c9de4806449bf --- BoardConfigCommon.mk | 6 ++++++ common.mk | 4 ++++ rootdir/etc/init.qcom.rc | 3 +++ sepolicy/vendor/genfs_contexts | 1 + sepolicy/vendor/hal_lineage_health_default.te | 2 ++ 5 files changed, 16 insertions(+) create mode 100644 sepolicy/vendor/hal_lineage_health_default.te diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 9c38c9e..f2bb7ae 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -173,6 +173,12 @@ BOARD_USES_QCOM_HARDWARE := true # Samsung BOARD_VENDOR := samsung +# Lineage Health +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH := /sys/class/power_supply/battery/batt_slate_mode +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_ENABLED := 0 +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_DISABLED := 1 +TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false + # DRM TARGET_ENABLE_MEDIADRM_64 := true diff --git a/common.mk b/common.mk index 8421d4c..87e8205 100644 --- a/common.mk +++ b/common.mk @@ -188,6 +188,10 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ vendor.lineage.fastcharge@1.0-service.samsung +# Lineage Health +PRODUCT_PACKAGES += \ + vendor.lineage.health-service.default + # FlipFlap PRODUCT_PACKAGES += \ FlipFlap diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 449cb2c..8e91694 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -88,6 +88,9 @@ on init chown root system /sys/fs/cgroup/memory/bg/tasks chmod 0660 /sys/fs/cgroup/memory/bg/tasks + # Charger + chown system system /sys/class/power_supply/battery/batt_slate_mode + on post-fs chmod 0755 /sys/kernel/debug/tracing diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index 1cc6fa4..c3a1497 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -23,6 +23,7 @@ genfscon sysfs /devices/virtual/lcd/panel/ genfscon sysfs /devices/platform/soc/9800000.qcom,npu/subsys6/ u:object_r:sysfs_npu:s0 genfscon sysfs /devices/platform/soc/soc:battery/power_supply/ u:object_r:sysfs_battery:s0 genfscon sysfs /devices/platform/soc/soc:battery/power_supply/battery/lcd u:object_r:sysfs_battery_writable:s0 +genfscon sysfs /devices/platform/soc/soc:battery/power_supply/battery/batt_slate_mode u:object_r:sysfs_battery_writable:s0 genfscon sysfs /devices/platform/soc/soc:sec-direct-charger/power_supply/ u:object_r:sysfs_battery:s0 genfscon sysfs /devices/platform/soc/890000.i2c/i2c-22/22-0049/ u:object_r:sysfs_battery:s0 genfscon sysfs /devices/platform/soc/890000.i2c/i2c-22/22-0057/ u:object_r:sysfs_battery:s0 diff --git a/sepolicy/vendor/hal_lineage_health_default.te b/sepolicy/vendor/hal_lineage_health_default.te new file mode 100644 index 0000000..63bea65 --- /dev/null +++ b/sepolicy/vendor/hal_lineage_health_default.te @@ -0,0 +1,2 @@ +rw_dir_file(hal_lineage_health_default, sysfs_battery_writable) +r_dir_file(hal_lineage_health_default, sysfs_battery) \ No newline at end of file