Snap for 4657601 from 7ea9b3164552606a74c2b58815eaa0bf947c5b3f to oc-m4-release

Change-Id: I19be21d1eae37af2ec5d70e24919a403029f49bc
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index efcf8bc..f50919c 100755
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -216,6 +216,8 @@
       RunCommandToFd(fd, "FP LOGS", {"qsee_logger", "-d"});
     }
 
+    DumpFileToFd(fd, "Battery type", "/sys/class/power_supply/bms/battery_type");
+
     RunCommandToFd(fd, "Battery cycle count", {"/vendor/bin/sh", "-c", "for f in 1 2 3 4 5 6 7 8 ; do echo $f > /sys/class/power_supply/bms/cycle_count_id; count=`cat /sys/class/power_supply/bms/cycle_count`; echo \"$f: $count\"; done"});
     return Void();
 };
diff --git a/sepolicy/vendor/dumpstate.te b/sepolicy/vendor/dumpstate.te
index ce328ce..e993200 100644
--- a/sepolicy/vendor/dumpstate.te
+++ b/sepolicy/vendor/dumpstate.te
@@ -11,3 +11,6 @@
 
   binder_call(dumpstate, per_mgr)
 ')
+
+allow hal_dumpstate sysfs_batteryinfo:dir search;
+allow hal_dumpstate sysfs_batteryinfo:file rw_file_perms;
diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts
index 6acbe84..58e4014 100644
--- a/sepolicy/vendor/genfs_contexts
+++ b/sepolicy/vendor/genfs_contexts
@@ -53,7 +53,6 @@
 genfscon sysfs /devices/soc/caa0000.qcom,jpeg                           u:object_r:sysfs_camera:s0
 genfscon sysfs /devices/soc/caa4000.qcom,fd                             u:object_r:sysfs_camera:s0
 genfscon sysfs /devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:qcom,pmi8998@2:qpnp,fg/power_supply/bms                        u:object_r:sysfs_batteryinfo:s0
-genfscon sysfs /devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:qcom,pmi8998@2:qpnp,fg/power_supply/bms/capacity               u:object_r:sysfs_batteryinfo:s0
 genfscon sysfs /devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:qcom,pmi8998@2:qcom,qpnp-smb2/power_supply/battery/capacity    u:object_r:sysfs_batteryinfo:s0
 genfscon sysfs /bus/msm_subsys                                          u:object_r:sysfs_msm_subsys:s0
 genfscon sysfs /module/subsystem_restart                                u:object_r:sysfs_msm_subsys_restart:s0
diff --git a/sepolicy/vendor/hal_power_default.te b/sepolicy/vendor/hal_power_default.te
index aa92c35..b588634 100644
--- a/sepolicy/vendor/hal_power_default.te
+++ b/sepolicy/vendor/hal_power_default.te
@@ -4,10 +4,7 @@
 allow hal_power_default sysfs_graphics:dir search;
 allow hal_power_default sysfs_graphics:file r_file_perms;
 
-userdebug_or_eng(`
-# debugfs entries are only needed in user-debug or eng builds
 allow hal_power_default debugfs_rpm:file r_file_perms;
 
 allow hal_power_default debugfs_wlan:dir r_dir_perms;
 allow hal_power_default debugfs_wlan:file r_file_perms;
-')
diff --git a/sepolicy/vendor/kernel.te b/sepolicy/vendor/kernel.te
index 2368646..d2bf9c0 100644
--- a/sepolicy/vendor/kernel.te
+++ b/sepolicy/vendor/kernel.te
@@ -1,7 +1,6 @@
 # for diag over socket
 userdebug_or_eng(`
   allow kernel self:socket create;
-  allow kernel debugfs_wlan:dir search;
 ')
 
 allow kernel vendor_firmware_file:dir search;
@@ -12,3 +11,5 @@
 
 allow kernel debugfs_ipc:dir search;
 allow kernel persist_file:dir search;
+
+allow kernel debugfs_wlan:dir search;