dumpstate: Add battery type to bugreport & fixup sepolicy

Add sepolicy for this operation, and update sepolicy to allow
collecting batteryinfo in bugreport for user builds.

Bug: 70094701, 70094083
Test: Take bugreport, verify battery type is present
Change-Id: Id67776301e2ed39a283a08483ac5eb8125aba96b
This commit is contained in:
Ajay Dudani
2017-12-04 17:44:01 -08:00
parent 6cbc6d9104
commit 22f01a2fa0
3 changed files with 5 additions and 1 deletions

View File

@@ -209,6 +209,8 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
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();
};