Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
Before this CL, we use packageManager to get uid for battery
restriction. However it may not be correct all the time.
For example, RestrictedAppDetails will be opened as main user
however inside we also show work profile apps, in this case
we can't get correct uid by only using normal API in PackageManager.
This CL change it to use uid from AppInfo, which is correct all
the time.
Bug: 79992590
Test: RunSettingsRoboTests
Change-Id: Id33a5f6409d6bace0d756e5ac06432acb8b2cf65
For each action, we add log when it is triggered.
RestrictAppAction could be triggered in multiple locations
(main page vs battery app detail page), so we add metricsKey to
distinguish them
Bug: 73888115
Test: RunSettingsRoboTests
Change-Id: I08f28431c4e891bf90816ce91f551edc671579cd
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 preferences to new postion
2. Change background activity pref from SwitchPreference to
Preference and update the controller
Bug: 72227981
Test: RunSettingsRoboTests
Change-Id: Ib18ac7523c24d19754c37ab8ac527095d9ced49c
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
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.
Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
Reusing the 'Background activity' switch found in App Info. The switch
now needs to be shown for all apps and will toggle another app op
RUN_ANY_IN_BACKGROUND which controls whether jobs or alarms are run for
background apps.
Also fixed handling of multiple packages with shared uid. The controller
was picking the first package for uid but the order of packages can
change on a reboot which would cause wrong app ops settings across
packages of the same uid.
Test: make -j32 RunSettingsRoboTests
Bug: 65176793
Change-Id: I2a9b96bc02730776172c3ae317cb7f7f890bec30
If app is device or profile app, we disable the background check
toggle. This cl also create an util method for this check and
remove duplicate code
Bug: 64665807
Test: RunSettingsRoboTests
Change-Id: Id8336eadaac8832327bc3653aaa7dfbacde352ac
In previous code, it didn't update summary when preference is changed.
This cl adds it and also updates the title for Battery Optimization.
Bug: 37163617
Test: RunSettingsRoboTests
Change-Id: I276d9a267379104794998a605a8e258660dcf350
DEFAULT is not actually the right thing; it's a subtlety used for
other things that have compound state. ALLOWED is the proper
outright "let this thing run free" state for this appop.
Also, set the appop only for the target package, not for the
entire uid.
Bug 37226920
Bug 37242946
Test: make RunSettingsRoboTests
Change-Id: I8c0a995b9519f980685e8573da946dcc93ac4e7c
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
We will show this preference only if the app is target prior to O
(targetSdk < O)
Bug: 33454801
Test: RunSettingsRoboTests
Change-Id: Ibd6a2147b8e7b49d2b7e3176296dd9b91ee4cc6f