dumpstate: Add battery cycle count to bugreport

Bug: 63841211
Test: Verify cycle count metrics are present in bugreport
Change-Id: I7c6a3af3ef687c99f88de5ee1c4d7433b618772e
This commit is contained in:
Ajay Dudani
2017-07-25 19:20:13 -07:00
parent 27efdfcceb
commit 38ef8d7082
3 changed files with 6 additions and 0 deletions

View File

@@ -207,6 +207,7 @@ Return<void> DumpstateDevice::dumpstateBoard(const hidl_handle& handle) {
RunCommandToFd(fd, "FP LOGS", {"qsee_logger", "-d"});
}
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();
};

View File

@@ -437,6 +437,10 @@ on boot
# Wifi firmware reload path
chown wifi wifi /sys/module/wlan/parameters/fwpath
# Allow system to write to cycle_count_id to iterate and get stats
chown system system /sys/class/power_supply/bms/cycle_count_id
chmod 0660 /sys/class/power_supply/bms/cycle_count_id
# default country code
setprop ro.boot.wificountrycode 00

View File

@@ -23,6 +23,7 @@ userdebug_or_eng(`
allow hal_dumpstate_impl debugfs_ipc:file r_file_perms;
allow hal_dumpstate_impl sysfs_usb_device:dir r_dir_perms;
allow hal_dumpstate_impl sysfs_usb_device:file r_file_perms;
allow hal_dumpstate_impl sysfs_msm_subsys:file write;
set_prop(hal_dumpstate_impl, modem_diag_prop)
')