Skip to content
Commit 2ad7cd41 authored by Adam Bookatz's avatar Adam Bookatz
Browse files

ScreenPowerCalculator is responsible for smearing

The estimated energy used by the screen is
smeared over all apps based on their foreground time.
This calculation is performed by BatteryStatsHelper after
most of its other processing.
In this cl, we move that logic to the ScreenPowerCalculator,
which is actually responsible for calculating the total and
app screen energy blaming. This also allows other power calculators
for screen usage (such as actual screen energy measurements) to
be hooked up in the future, without BSH worrying about whether to
smear.

Note: Smeared energy is not included in the app's total energy usage
until the very end; prior to that, it is recorded in a special field
BatterySipper.screenPowerMah. This is NOT changed in this cl.

NOTE: The actual smearing algorithm is NOT altered in this cl.

Test: atest BatteryStatsHelperTest
Bug: 174818228
Bug: 162379528
Change-Id: I30b436b736e96071a1e4167d37512d250119665c
Merged-In: I30b436b736e96071a1e4167d37512d250119665c
(cherry picked from commit 3754504f)
parent 11d9d6cf
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