Browse Source

sm8450-common: Build Lineage PowerShare HAL

Change-Id: I3ea02cd0c6b1a26851f1961768e00e5f3339c4bb
Signed-off-by: Jens Reidel <[email protected]>
Jens Reidel 1 year ago
parent
commit
8c6add2160

+ 5 - 0
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

+ 4 - 0
common.mk

@@ -366,6 +366,10 @@ PRODUCT_COPY_FILES += \
 PRODUCT_PACKAGES += \
     libgrpc++_unsecure.vendor
 
+# PowerShare
+PRODUCT_PACKAGES += \
+    [email protected]
+
 # Protobuf
 PRODUCT_PACKAGES += \
     libprotobuf-cpp-full-3.9.1-vendorcompat \

+ 3 - 0
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

+ 3 - 0
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\[email protected]\.xiaomi-multihal u:object_r:hal_sensors_default_exec:s0
 /(vendor|system/vendor)/bin/hw/[email protected] u:object_r:vendor_hal_sensorcommunicate_default_exec:s0

+ 3 - 0
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

+ 2 - 0
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;