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)
Loading
Please register or sign in to comment