Commit Graph

18 Commits

Author SHA1 Message Date
Tiffany Nguyen
3acd34fe4a Move restricted apps page to new battery optimization page.
New entry: https://screenshot.googleplex.com/BbU6RnQhBbpnBc3.png
Restricted: https://screenshot.googleplex.com/5ggid7TcSsH9CUF.png
Old entry: https://screenshot.googleplex.com/7JgZpSfKs5zZb3Z.png

Bug: 240711616
Test: manual
Change-Id: I03d17beac0fb85a3d17acd7d0d581feb35e9582b
2022-08-16 22:38:05 +00:00
ykhung
a3d3c22a27 Add metric for new battery relative functions for S (1/2)
Reference the table from PM requested:
https://docs.google.com/spreadsheets/d/1TC_6MLVMvOS0p1ic0wPfQ-19AOuY8Kc8FUJdqaQSM4I/edit?ts=6098b296#gid=0

Bug: 188505537
Test: make SettingsRoboTests
Change-Id: I2a4df9ab900cbeaf9885bb2dbc21ea848920bc81
2021-05-19 12:22:20 +00:00
Raff Tsai
8291671f97 Fix testcase error and UI refresh issue
Restricted App list can be update in RestrictedAppDetails page and
go back to SmartBatterySettings page without update the App list.
We need to update the list in updateState() again.

Fixes: 140585454
Test: manual, robolectric
Change-Id: I48a197351ffb9b07490f1de7ba1f7417102458a2
2019-09-09 12:00:21 +08:00
Raff Tsai
8641986401 Prevent UI jank
Move hide preference logic to getAvailabilityStatus, it can remove
the preference before onresume.

Fixes: 140366463
Test: manual, robolectric
Change-Id: Ie11b5357b1e9340b30b8f19eac60c479cdb7687e
2019-09-03 14:16:27 +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
Lei Yu
fca1b345cc Merge "Fix bugs in auto restriction." into pi-dev am: f6e2c19fcc
am: a9e4d4a42a

Change-Id: If82969696eb492ea3875a0e0fb92f038024f00f9
2018-04-23 10:13:31 -07:00
Lei Yu
252d4e1fc0 Fix bugs in auto restriction.
1. Dismiss this tip once user clicks it and goes to detail page.
2. In auto restriction, since apps are automatically restricted,
we need to remove apps in list that unrestricted by user.
3. Refactor the code to remove the unnecessary parameter(i.e.
SettingsActivity)

Bug: 78187414
Test: RunSettingsRoboTests
Change-Id: I1c950f7c55df35795641c2ea8579ce9e011dba28
2018-04-20 12:55:53 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Lei Yu
9d2c7e822b Hide preference when no app restricted
Change-Id: I37135bce5354ce7380441f86f94cb79d89cc500c
Fixes: 77799629
Test: RunSettingsRoboTests
2018-04-09 12:23:52 -07:00
Lei Yu
37d29ee6a6 Only show restricted apps that belong to the user.
Filter out the restricted apps that not belong to the correct user, in
this way secondary user cannot see what apps been restricted by primary
user.

Bug: 74076658
Test: RunSettingsRoboTests
Change-Id: I8471f07be747c177f8611cdc1973a8420dc41296
2018-03-21 15:27:14 -07:00
Lei Yu
6c16840ff5 Add summary for battery manager preference
Show different summary based on whether it is on and there is restricted
apps.

Also move method to get restricted app list to BatteryTipUtils since it
is used in 2 places.

Bug: 73018395
Test: RunSettingsRoboTests
Change-Id: Ib2306e0fd1f520fde6d1403ce9c527c241d36005
2018-03-19 19:27:36 -07:00
Lei Yu
cb77823b65 Update the restrict app list
Before this cl, we use getPackagesForOps() to populate restrict app
list. However in that API not all the apps are currently restricted,
so in this cl we filter out all the allowed apps.

Bug: 73085780
Test: RunSettingsRoboTest
Change-Id: Ia7c1eb95b07a1a0d203b394eb64dcd98d25bd561
2018-03-13 10:44:45 -07:00
jackqdyulei
c7a0c33ab5 Update fuelguage to use uid in AppInfo
The uid is needed to distinguish the same app used
by different users(even work profile user). So
we need to store the correct uid in AppInfo and
use it across the settings app.

Bug: 74022362
Test: RunSettingsRoboTests
Change-Id: Iaa0ea1ac1fbd3a3a1251e0cd1096d6a8c75c4ed8
2018-03-08 01:33:54 +00:00
jackqdyulei
1b472be833 Add action to open the anomaly detail page
This action is used to go to the anomaly detail page.
This cl also refactored the RestrictedAppDetails to take AppInfo
as the input, not AppOpsManager.PackageOps.

Bug: 72385333
Test: RunSettingsRoboTests

Change-Id: I5b4481091635e1250629ea21c2b650db929c18ed
2018-02-21 17:58:36 -08:00
Fan Zhang
be45f9c865 Migrate more settings to SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I4100bef20e2ed477e4e31c9b7816f1b03f3f2809
2018-02-19 13:36:57 -08:00
jackqdyulei
0fb2d68f97 Add restrict app detail page
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
2018-01-19 09:59:53 -08:00
jackqdyulei
131d3b3c2f Add smart battery page for battery settings
This page contains prefs for smart battery and app restriction.

Bug: 71502850
Test: RunSettingsRoboTests

Change-Id: I194af30cbc7b2496b10098fcb67f1116e0722310
2018-01-09 12:05:36 -08:00