Skip to content
Commit 99e57c3c authored by Mike Ma's avatar Mike Ma Committed by Bookatz
Browse files

Remove which from BatteryStats

BatteryStats tracks three "which" states:
STATS_SINCE_CHARGED,
STATS_CURRENT,
STATS_SINCE_UNPLUGGED

However, only STATS_SINCE_CHARGED is really needed; the other two
just take up a lot of unjustifiable RAM. We therefore remove them from
the implementation here.
We also remove mLastTime and mLastCount from Timers and Counters, since
it was always zero anyway.

While the other two "whiches" are left as constants, they are ignored,
and all functions treat any which as STATS_SINCE_CHARGED. In particular,
SystemHealthManager now uses STATS_SINCE_CHARGED, rather than
STATS_SINCE_UNPLUGGED for all of its Battery statistics.

This is adapted from ag/4310406, but slimmed down to just the 'which'
removal parts.

Bug: 70892428
Test: com.android.internal.os.BatteryStatsTests
Change-Id: I86f2743ff30afc15bbaa12c68f3206ea528857a1
parent 47119cf9
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