diff --git a/BoardConfig.mk b/BoardConfig.mk index e2b2c28..b05e5dc 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -112,6 +112,9 @@ DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \ DEVICE_MATRIX_FILE := hardware/qcom-caf/common/compatibility_matrix.xml DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/vintf/manifest.xml +# Lineage Health +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH := /sys/class/qcom-battery/charging_enabled + # Metadata BOARD_USES_METADATA_PARTITION := true diff --git a/device.mk b/device.mk index 0e39000..07e10c9 100644 --- a/device.mk +++ b/device.mk @@ -240,6 +240,10 @@ PRODUCT_SET_DEBUGFS_RESTRICTIONS := true PRODUCT_PACKAGES += \ android.hardware.lights-service.qti.nothing +# Lineage Health +PRODUCT_PACKAGES += \ + vendor.lineage.health-service.default + # Media PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/media/media_codecs_performance_yupik_v1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_yupik_v1.xml \ diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc index 4cc5247..01f92d8 100644 --- a/rootdir/etc/ueventd.qcom.rc +++ b/rootdir/etc/ueventd.qcom.rc @@ -487,3 +487,6 @@ firmware_directories /vendor/firmware_mnt/image/ /mnt/vendor/persist/ /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 + +# Battery +/sys/class/qcom-battery charging_enabled 0660 system system diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index 430e4ba..8998897 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -1,3 +1,6 @@ +# Charging Control +genfscon sysfs /class/qcom-battery/charging_enabled u:object_r:vendor_sysfs_usb_supply:s0 + # Display genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary u:object_r:vendor_sysfs_graphics:s0 diff --git a/sepolicy/vendor/hal_lineage_health.te b/sepolicy/vendor/hal_lineage_health.te new file mode 100644 index 0000000..2986fdf --- /dev/null +++ b/sepolicy/vendor/hal_lineage_health.te @@ -0,0 +1,3 @@ +r_dir_file(hal_lineage_health_default, vendor_sysfs_battery_supply) +allow hal_lineage_health_default vendor_sysfs_battery_supply:file rw_file_perms; +allow hal_lineage_health_default vendor_sysfs_battery_supply:dir search; \ No newline at end of file