From f9b805052d4fc13a4ff860164e44a970b99b1d87 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 4b2c2e1..e618039 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -179,6 +179,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 f9e5f9d..432e817 100644 --- a/common.mk +++ b/common.mk @@ -187,6 +187,10 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ vendor.lineage.fastcharge@1.0-service.samsung +# Lineage Health +PRODUCT_PACKAGES += \ + vendor.lineage.health-service.default + # FM PRODUCT_PACKAGES += \ FM2 \ 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 ad62708..e977863 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -22,6 +22,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