From 9a202f1a3b9ca0181af2b538065fa4043769c8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20=7C=20=E3=82=A2=E3=83=B3=E3=83=87=E3=82=A3?= Date: Thu, 14 Sep 2023 14:58:03 +0800 Subject: [PATCH] sm6375-common: Build Lineage Health --- BoardConfigCommon.mk | 7 +++++++ holi.mk | 2 ++ rootdir/etc/ueventd.qcom.rc | 3 +++ .../vendor/lineage_health/hal_lineage_health_default.te | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 sepolicy/vendor/lineage_health/hal_lineage_health_default.te diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 860cc00..bbf4743 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -117,7 +117,14 @@ TARGET_USES_ION := true TARGET_DISABLED_UBWC := true # Lineage Health +ifneq ($(wildcard hardware/*/interfaces/health),) TARGET_HEALTH_CHARGING_CONTROL_SUPPORTS_BYPASS := false +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH := /sys/class/power_supply/battery/input_suspend +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_ENABLED := 0 +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_DISABLED := 1 + +BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor/lineage_health +endif # Partitions BOARD_BOOTIMAGE_PARTITION_SIZE := 134217728 diff --git a/holi.mk b/holi.mk index a67cce0..3ec90fe 100644 --- a/holi.mk +++ b/holi.mk @@ -328,8 +328,10 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml # Lineage Health +ifneq ($(wildcard hardware/*/interfaces/health),) PRODUCT_PACKAGES += \ vendor.lineage.health-service.default +endif # Power PRODUCT_PACKAGES += \ diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc index 26738e4..838e749 100644 --- a/rootdir/etc/ueventd.qcom.rc +++ b/rootdir/etc/ueventd.qcom.rc @@ -489,3 +489,6 @@ firmware_directories /vendor/firmware_mnt/image/ /sys/devices/platform/soc/*.i2c/i2c-*/*-*/iio:device* in_temp_raw 0664 system system /sys/devices/platform/soc/*.i2c/i2c-*/*-*/iio:device* in_temp_scale 0664 system system /sys/devices/platform/soc/*.i2c/i2c-*/*-*/iio:device* in_temp_scale_available 0664 system system + +# Charger +/sys/class/power_supply/battery input_suspend 0660 system system diff --git a/sepolicy/vendor/lineage_health/hal_lineage_health_default.te b/sepolicy/vendor/lineage_health/hal_lineage_health_default.te new file mode 100644 index 0000000..a636511 --- /dev/null +++ b/sepolicy/vendor/lineage_health/hal_lineage_health_default.te @@ -0,0 +1,4 @@ +rw_dir_file(hal_lineage_health_default, vendor_sysfs_battery_supply) + +r_dir_file(hal_lineage_health_default, sysfs_batteryinfo) +allow hal_lineage_health_default sysfs_batteryinfo:file rw_file_perms;