Label vendor sys/*/power_supply/* as sysfs_batteryinfo
thermal-engine access to sysfs_batteryinfo.
Bug: 65643247
Bug: 70275668
Test: device boots with no denial to sysfs_batteryinfo or
sysfs_msm_subsys.
Change-Id: I75cf2cfdca5cdec5d2c4713b3a11bfb32bc1556c
diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts
index 0f54958..d18696f 100644
--- a/sepolicy/genfs_contexts
+++ b/sepolicy/genfs_contexts
@@ -49,8 +49,12 @@
genfscon sysfs /devices/soc/0.qcom,rmtfs_sharedmem u:object_r:sysfs_rmtfs:s0
genfscon sysfs /devices/soc/84000000.qcom,rmtfs_rtel_sharedmem u:object_r:sysfs_rmtfs:s0
genfscon sysfs /module/lpm_levels/parameters u:object_r:sysfs_power_management:s0
-genfscon sysfs /devices/soc/qpnp-fg-17/power_supply/bms/capacity u:object_r:sysfs_batteryinfo:s0
-genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply/battery/capacity u:object_r:sysfs_batteryinfo:s0
+genfscon sysfs /devices/soc/6a00000.ssusb/power_supply u:object_r:sysfs_batteryinfo:s0
+genfscon sysfs /devices/soc/75b5000.i2c/i2c-7/7-001d/power_supply u:object_r:sysfs_batteryinfo:s0
+genfscon sysfs /devices/soc/msm-bcl-14/power_supply u:object_r:sysfs_batteryinfo:s0
+genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply u:object_r:sysfs_batteryinfo:s0
+genfscon sysfs /devices/soc/qpnp-fg-17/power_supply u:object_r:sysfs_batteryinfo:s0
+genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply u:object_r:sysfs_batteryinfo:s0
genfscon sysfs /devices/virtual/timed_output/vibrator/voltage_level u:object_r:sysfs_vibrator:s0
genfscon sysfs /module/diagchar/parameters/timestamp_switch u:object_r:sysfs_timestamp_switch:s0
genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply/battery/system_temp_level u:object_r:sysfs_msm_subsys:s0
diff --git a/sepolicy/thermal-engine.te b/sepolicy/thermal-engine.te
index a07ecc5..cd414c4 100644
--- a/sepolicy/thermal-engine.te
+++ b/sepolicy/thermal-engine.te
@@ -20,6 +20,9 @@
allow thermal-engine sysfs_thermal:lnk_file read;
allow thermal-engine sysfs_thermal:dir search;
+r_dir_file(thermal-engine, sysfs_batteryinfo)
+allow thermal-engine sysfs_batteryinfo:file w_file_perms;
+
# /proc/stat
allow thermal-engine proc_stat:file { getattr open read };