summaryrefslogtreecommitdiff
path: root/startop/scripts/lib/cmd_utils.py
diff options
context:
space:
mode:
authorHui Yu <huiyu@google.com>2019-06-13 10:42:48 -0700
committerHui Yu <huiyu@google.com>2019-06-13 10:42:48 -0700
commit5b4edd60380f68d5ecd054c21fe3dae9fde84369 (patch)
tree29bd6000d7619737478d66add94cb79a3e9ab0c6 /startop/scripts/lib/cmd_utils.py
parentb230dd4fe69d043ce90b5960295effb2464dc133 (diff)
Fix the missing longwake finish event problem.
When starting a new batteystats history file, before inserting a new CMD_CURRENT_TIME HistoryItem at beginning of the history buffer, make a copy of the current HistoryItem. Otherwise the current HistoryItem could be overriden by the CMD_CURRENT_TIME and we lose a HistoryItem. In b/130083227, the longwake start event happends before opening the new history file, after CMD_CURRENT_TIME event, the longwake finish event is missing. The fix is to make a copy of current HistoryItem before adding CMD_CURRENT_TIME event. Change-Id: I5048f98b6b47f54336fb01e354fb5a6284c84b43 Fix: 130083227 Test: b/130083227 can be reproduced by createFakeHistoryEvents() call, missing longwake finish event can be seen after "TIME:" record. With the fix, no more missing longwake finish event after "TIME:" record. “adb shell dumpsys batterystats --history-create-events 50000” to create enough events to start new history files, “adb shell dumpsys batterystats --history” to observe all history records.
Diffstat (limited to 'startop/scripts/lib/cmd_utils.py')
0 files changed, 0 insertions, 0 deletions