Wakeup alarm count frequent is calculated by a / b, where
1. a: the total wakeup alarm count since the last full charge
2. b: total time running since last full charge
(include sleeping time)
This cl also has the following changes:
1. Move bunch of methods to BatteryUtils
2. Create type WAKEUP_ALARM
3. Add and update tests
Upcoming cl will make sure we get the threshold from
AnomalyDetectionPolicy
Bug: 36921529
Test: RunSettingsRoboTests
Change-Id: I4f7b85606df68b6057f6c7d3f3be7f9a9a747f1d
There are some miscalculations in state FOREGROUND_SERVICE and
FOREGROUND, so we move them out of the foreground time for now.
We will fix it after O and may add them back later.
Bug: 37000096
Test: RunSettingsRoboTests
Change-Id: Ic3f2f7fa69e8a213895c601630d1cca94fd32220
That state means the time when app is on top while screen is off,
we should not count it as foreground usage time.
Bug: 37547898
Test: RunSettingsRoboTests
Change-Id: I67e0c135d0c4b71cd667037b0d5dc7673b53607e
Talk back will read "Used for 3m" as "Used for 3 meters", but
it will read "Used for 3h 3m" correctly.
This cl add specific Ttsspan if the time only contains "minute"
Bug: 36379530
Test: Run SettingsRoboTests
Change-Id: I033575938cce24221980dddd9d66be4e18804541
This cl moves following methods to BatteryUtils:
1. shouldHideSipper
2. removeHiddenBatterySippers
3. calculateBatteryPercent
As a result, we could use these methods in battery page as well
as app info page.
This cl also move bunch of tests to new file and add test for
method calculateBatteryPercent
Bug: 36816681
Test: RunSettingsRoboTests
Change-Id: Ic32700fe9741fbb96363db4af2d4fccb3ee8e317
This cl add logs to get more data for app usage time.
Also refactor BatteryUtils to singleton pattern because we need
to extract package name from uid.
Bug: 36909166
Test: RunSettingsRoboTests
Change-Id: I6ede354035c46e46cb856b7cf57bd1b7ccbd6d4f
This cl adds AdvancedPowerUsageDetail to show the usage details page.
The AdvancedPowerUsageDetail contains all the needed ui components:
1. App Header
2. Two buttons
3. Usage breakdown preference category
4. Power management preference category
This cl also adds preference controller for two buttons but the
detail implementation will be added in the following cl.
Following cl will also remove previous detail page.
Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: I17f95d1288762094671c0f148fa73367e51f175e