Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5b4edd60 authored by Hui Yu's avatar Hui Yu
Browse files

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.
parent b230dd4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment