From 8c6add216096e63814c7d3e1601c4a32683c7796 Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Sat, 15 Jul 2023 16:08:38 +0300 Subject: [PATCH] sm8450-common: Build Lineage PowerShare HAL Change-Id: I3ea02cd0c6b1a26851f1961768e00e5f3339c4bb Signed-off-by: Jens Reidel --- BoardConfigCommon.mk | 5 +++++ common.mk | 4 ++++ rootdir/etc/ueventd.qcom.rc | 3 +++ sepolicy/vendor/file_contexts | 3 +++ sepolicy/vendor/genfs_contexts | 3 +++ sepolicy/vendor/hal_lineage_powershare_default.te | 2 ++ 6 files changed, 20 insertions(+) create mode 100644 sepolicy/vendor/hal_lineage_powershare_default.te diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index b05a7e0..af961f9 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -190,6 +190,11 @@ TARGET_BOARD_PLATFORM := taro # Power TARGET_POWERHAL_MODE_EXT := $(COMMON_PATH)/power/power-mode.cpp +# PowerShare +SOONG_CONFIG_NAMESPACES += XIAOMI_POWERSHARE +SOONG_CONFIG_XIAOMI_POWERSHARE := WIRELESS_TX_ENABLE_PATH +SOONG_CONFIG_XIAOMI_POWERSHARE_WIRELESS_TX_ENABLE_PATH := /sys/class/qcom-battery/reverse_chg_mode + # Properties TARGET_ODM_PROP += $(COMMON_PATH)/properties/odm.prop TARGET_PRODUCT_PROP += $(COMMON_PATH)/properties/product.prop diff --git a/common.mk b/common.mk index 848e2e2..8478179 100644 --- a/common.mk +++ b/common.mk @@ -366,6 +366,10 @@ PRODUCT_COPY_FILES += \ PRODUCT_PACKAGES += \ libgrpc++_unsecure.vendor +# PowerShare +PRODUCT_PACKAGES += \ + vendor.lineage.powershare@1.0-service.xiaomi + # Protobuf PRODUCT_PACKAGES += \ libprotobuf-cpp-full-3.9.1-vendorcompat \ diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc index 1c67e58..d32d2c1 100644 --- a/rootdir/etc/ueventd.qcom.rc +++ b/rootdir/etc/ueventd.qcom.rc @@ -504,3 +504,6 @@ subsystem mem_buf_vm # devcoredump data attributes /sys/class/devcoredump/devcd* data 0600 system system + +# Battery +/sys/class/qcom-battery reverse_chg_mode 0644 system system diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 7d4294b..cca649e 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -71,6 +71,9 @@ # Modem /dev/smd8 u:object_r:vendor_radio_smd_device:s0 +# Powershare +/vendor/bin/hw/vendor\.lineage\.powershare@1\.0-service\.xiaomi u:object_r:hal_lineage_powershare_default_exec:s0 + # Sensors /(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@2.1-service\.xiaomi-multihal u:object_r:hal_sensors_default_exec:s0 /(vendor|system/vendor)/bin/hw/vendor.xiaomi.sensor.communicate@1.0-service u:object_r:vendor_hal_sensorcommunicate_default_exec:s0 diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index dce17cc..c0e6c37 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -1,3 +1,6 @@ +# Battery +genfscon sysfs /class/qcom-battery u:object_r:vendor_sysfs_battery_supply:s0 + # Extcon genfscon sysfs /devices/platform/soc/88e0000.qcom,msm-eud/extcon u:object_r:sysfs_extcon:s0 genfscon sysfs /devices/platform/soc/soc:qcom,msm-ext-disp/extcon u:object_r:sysfs_extcon:s0 diff --git a/sepolicy/vendor/hal_lineage_powershare_default.te b/sepolicy/vendor/hal_lineage_powershare_default.te new file mode 100644 index 0000000..e591663 --- /dev/null +++ b/sepolicy/vendor/hal_lineage_powershare_default.te @@ -0,0 +1,2 @@ +allow hal_lineage_powershare_default vendor_sysfs_battery_supply:dir search; +allow hal_lineage_powershare_default vendor_sysfs_battery_supply:file rw_file_perms;