OSDN Git Service

Avoid background getTotalTimeLocked misreporting
authorBookatz <bookatz@google.com>
Wed, 7 Jun 2017 19:30:07 +0000 (12:30 -0700)
committerBookatz <bookatz@google.com>
Wed, 7 Jun 2017 20:29:41 +0000 (13:29 -0700)
commit6d79993cb3abaf7667dbadf1d9d8c5d63374af8d
treecc918c0bf7871ba50b2080b30f86d6e192a433c3
parent2b2221e94bd4b299ccbcbc76d636ba0b231794db
Avoid background getTotalTimeLocked misreporting

It has been discovered that for background values of
AggregatedWakelock, Sync, Job, and partial wakelocks,
the value of getTotalTimeLocked is wrong and often very
negative. getTotalDurationMsLocked, which should provide the exact same
value in all of these cases (since background data is never pooled),
does not have this problem. So while the source of the bug is sought
out, we should use getTotalDurationMsLocked instead of getTotalTimeLocked for
these data.

Bug: 62352334
Test: cts-tradefed run cts-dev -m CtsDumpsysHostTestCases -t android.dumpsys.cts.BatteryStatsDumpsysTest
Change-Id: I78e84368615578483ab8e9e5f0ee1d067491be08
core/java/android/os/BatteryStats.java