We don't need it anymore because we don't auto restrict this
anomaly.
Bug: 79210436
Test: robo test still pass
Change-Id: I186213a57f9bf54a0e19985f2c92169c6dc0571c
Before this CL, we assumed all the apps in this page were restricted and
didn't consider that user may uncheck one and rotate the screen.
In this CL, when we create checkbox, we will update the state through
FAS API to make sure checkbox is up-to-date.
Change-Id: I4e89908591f0688b4170806db4b6631bf921f2e9
Fixes: 78161466
Test: RunSettingsRoboTests
In this CL, don't blame system app in anomaly detection and also
add log for it.
Following CL will update it to also check whether this system app
has launch entry.
Bug: 77477987
Test: RunSettingsRoboTests
Change-Id: I97490b32bc42ec2f8e03ec2d82f7c8bf89f9c66f
This only happens in new device with broken power_profile.xml, in
which it doesn't have screen power model.
This CL catches the null pointer crash and log it.
Change-Id: Iac23e3a8fc51385bdb22979c4b59000319f6fd49
Fixes: 74617269
Test: RunSettingsRoboTests
This allows Settings to test against the latest framework changes.
Also replaced TestConfig with traditional robolectric.properties.
Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
Add a fake unrestrict tip so we could reuse the BatteryTipDialogFragment
to build the unrestrict dialog.
After this cl, restrict dialog has two types:
1. dialog to only restrict one app
2. dialog to restrict more than one app
Will add dialog to restrict more than 5 apps when strings are finalized.
Bug: 72385333
Bug: 72227981
Test: RunSettingsRoboTests
Change-Id: Ib0328f0386efad525b331fd713dd15d060a1a649
1. Move force standby action to BatteryUtils
2. Add click action for restricted preference(go to detail page)
3. Build app list in detail page using packageOps list
Bug: 71502850
Test: RunSettingsRoboTests
Change-Id: I1e6733e5402e7a854b07a8bbb43a86255276bfaa
1. Add both model and detector
2. Move the screen usage method to BatteryUtils
so we could reuse it.
3. Add and update the tests
Bug: 70570352
Test: RunSettingsRoboTests
Change-Id: I6a7248d9d48ee8cb6fc2c18c8c225210d49b6bc9
Add foreground service time to foreground usage time of apps. This will
account for app usage that user is aware of but is not being displayed
on screen, such as playing music while screen is locked.
Change-Id: Ica9fe0819e46b50299eb2eab7f0483ea01441fb0
Fixes: 38313557
Test: RunSettingsRoboTests
This cl make it could have multiple actions for each anomaly type.
This includes:
1. Add field "targetSdkVersion", "bgRestrictionEnabled" in Anomaly
2. Add new action which includes "force stop" and "background check"
3. Add "sdkVersion" and "bgRestrictionEnabled" method in BatteryUtils
4. Update BackgroundCheckAction to check sdkVersion first
5. Update serveral tests and add new test
Bug: 63037765
Test: RunSettingsRoboTests
Change-Id: Iea7a131ee57d501f7737ae4a3ba672d948d05cd8
For now it uses MIN(STATE_TOP_TIME, FOREGROUND_ACTIVITY_TIME) and this
method is used in both display and screen smearing.
Bug: 63080621
Test: RunSettingsRoboTests
Change-Id: I2ca3109697aa66fae67d8b2f4f10c4d08bb99d59
The parameter in timer should be microseconds, not milliseconds
Bug: 63073847
Test: RunSettingsRoboTests
Change-Id: I5e451aee9eb30815fbefe12c0bfdc85dff884b8e
This cl changes it to:
foregroundTime = MIN(topTime, foregroundActivityTime);
Bug: 62884954
Test: RunSettingsRoboTests
Change-Id: I236c18b19c4f06c5a6d018bc06ffb9862af51de2
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.
Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
Then we could make sure the app list is sorted
Bug: 62035385
Test: RunSettingsRoboTests
Change-Id: I3fa3d6ffc5930cf011e382632143e459fdbc4369
Merged-In: I3fa3d6ffc5930cf011e382632143e459fdbc4369
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