OSDN Git Service

Reset BatteryStats when too large for clients to handle
authorAdam Lesinski <adamlesinski@google.com>
Fri, 16 Dec 2016 07:45:17 +0000 (23:45 -0800)
committerAdam Lesinski <adamlesinski@google.com>
Fri, 16 Dec 2016 19:27:53 +0000 (19:27 +0000)
commit45489787d7f84a5530c1e88bebc1eb6aa614bd74
tree56f417a690cf7908213670d3e40be0e6cafca212
parentad7fe271aeddfcc986982c83dc93baeb3d149845
Reset BatteryStats when too large for clients to handle

When BatteryStats history is too large, the Settings app crashes.
Reset the battery stats by marking an *OVERFLOW* event at the
beginning of the newly reset history.

This seems to happen in Retail mode when the devices are on charger
for an extended period of time and accumulate a sufficiently large
history. Resetting makes sense because the phone is most likely
charged and will reset anyways when unplugged.
Bug: 32540341
Test: Manual

Change-Id: I8c2892458b5d9ce64b1c44aa2e2a000340e71e63
core/java/com/android/internal/os/BatteryStatsImpl.java