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

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

Measured screen energy into BatteryStatsHelper

Use measured screen energy usage (where available)
in battery reporting in BatteryStatsHelper, including
total and per-app screen energy usage.

Regardless of the data source (measured screen power usage vs.
estimating from screen time), the blame on apps is 'smeared',
meaning that it is apportioned (after-the-fact) based on each
app's foreground usage. That does not change here.

Also fixes a mistake in Uid.getScreenOnEnergy().

Future followups to do
1. Make getMeasuredOrEstimatedPower more universal (as more
   PowerCalculators follow suit)
2. Support for BatteryUsageStats
3. Deal with voltage properly
4. Toggle whether to report the measured energy on/off.

Test: atest BatteryStatsHelperTest
Bug: 174818228
Change-Id: I0eaa4bc594cb31b4a26b5488b08114cbf80e3884
Merged-In: I0eaa4bc594cb31b4a26b5488b08114cbf80e3884
(cherry picked from commit 30594e82)
parent d98aa4ea
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