Drop TAG_FIRST_OCCURRENCE_FLAG when populating history tag array
When there are more than MAX_HISTORY_BUFFER of history events,
we store the history buffer and create a new one. At that point,
we set the TAG_FIRST_OCCURRENCE_FLAG flag on all pre-existing indexes
in the history tag pool to indicate that those tags have not yet
occurred in the current history buffer and therefore would still
need to be written into the buffer if they occur in the future.
As a result, we end up with some indexes in the history tag pool
having the TAG_FIRST_OCCURRENCE_FLAG set. We need to reset this flag
when adding tags to mHistoryTags in order to restore the natural
sequence of indexes.
Bug: 206823946
Test: atest CtsDumpsysHostTestCases:BatteryStatsDumpsysTest
Change-Id: I3affd09ea45accf3ac8706bd8114d0d7ca385a69
1 file changed