Commit Graph

13 Commits

Author SHA1 Message Date
Arc Wang
f81d22ef28 Fix battery optimization display problems
Root cause:
RequestIgnoreBatteryOptimizations adds package in
PowerWhitelistManager#addToWhitelist for intent
Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS.

Settings UI uses PowerAllowlistBackend to check if
an APP is in power allow list. Each UI component should
PowerAllowlistBackend#refreshList() or UI will get
a stale result.

Solution:
This change fixes below display problems by refreshing
allow list from DeviceIdleController service.

1. Battery optimization summary in Battery usage details.
2. Battery optimization list.

BYPASS_INCLUSIVE_LANGUAGE_REASON=I need the object name
to describe the root cause.

Bug: 171064162
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BatteryOptimizationPreferenceControllerTest
      manual
      Switch battery optimazion of a APP and observer the UI display.
Change-Id: I75b269eec5d1b904dcaa71948798f169d4e4ddfa
2020-11-24 16:28:04 +08:00
Edgar Wang
f480c1c3fc Update language to comply with Android's inclusive language guidance
Refactor PowerWhitelistBackend to PowerAllowlistBackend
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: I3d56e6dac1515b49a89f59c34edf403ecb891420
2020-08-04 15:47:57 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Fan Zhang
7e395e1a00 Plumb context object to PowerWhitelistBackend.
Change-Id: Ice0d037625d47f1f668b00499a7f1ad2302cc0ba
Fixes: 76435804
Test: robotests
2018-05-29 22:32:22 +00:00
hjchangliao
e86eec0c07 Rename SubSettingLauncher.setTitle, add java doc
For make this method usage more clear,
setTitle(charSequence) rename as setTitleText,
add java doc: it is only for user generated string
setTitle(int) rename as setTitleRes.

Change-Id: I972cb6a8ff90873dfdc25c23f6dc3d68103c8e4e
Fixes: 78347436
Test: make RunSettingsRoboTests
2018-05-09 10:00:05 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
7cf99f5f12 Migrate more settings to use SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I08f6f380489646231d6d8ceb1488e2efb036bf69
2018-02-18 21:10:03 -08:00
Tony Mantler
bf25160090 Move PowerWhitelistBackend to SettingsLib
Bug: 70716754
Test: RunSettingsRoboTests
Change-Id: I897ce3469bb2d72a0cbe96b16b8de1a565ba4e64
2017-12-15 12:58:34 -08:00
Fan Zhang
a8cac7a409 Move ManageApplications to sub package and remove dead code
Bug: 64804294
Test: rerun test
Change-Id: I23cbd8da9b65f52470030ba3b9b676ece2bada11
2017-10-12 13:48:54 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
jackqdyulei
781c3000d1 Update Summary for Battery Optimization
Bug: 37221696
Test: RunSettingsRoboTests
Change-Id: I7dc24879521a1375e0ad4b4b73e9a40633b93c3f
2017-04-12 13:04:28 -07:00
jackqdyulei
ddba966700 Revamp the battery usage details page.
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
2017-03-24 20:58:44 -07:00