Commit Graph

2300 Commits

Author SHA1 Message Date
TreeHugger Robot
2f40a918e1 Merge "Update App battery usage page and add tests." into tm-qpr-dev am: 50c7cb834e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19951824

Change-Id: I680de6c08f5a1533779f4c73ff1bd3f7cd8ad0d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-16 08:37:40 +00:00
Tiffany Nguyen
99d3b54a70 Update App battery usage page and add tests.
- Add tests
- Remove duplicated "Set battery usage for apps" text
- Clean up some code

Screenshot: https://screenshot.googleplex.com/8LHhyxFA6X4ZFkT.png

Test: make RunSettingsRoboTests -j40
Bug: 244995036
Change-Id: Iaac9b0af10f541100e91b10affacf3307bd5edca
2022-09-15 13:40:12 +00:00
YK Hung
1a7168a114 Merge changes from topic "app_battery_usage" into tm-qpr-dev am: 0bad72889e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19726220

Change-Id: Ie2f3751d89e77aecc9a5e799127ea8c8d1478430
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 04:04:22 +00:00
Tiffany Nguyen
d36c2f7cba Align strings and UX across the different pages. am: c2ad30d432
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19728353

Change-Id: I0eabd6c4dd7f42020c2551f1f63f1cf20de33b23
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 04:04:20 +00:00
Tiffany Nguyen
9e491e0f1b Move restricted apps page to new battery optimization page. am: 032649b4f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19727752

Change-Id: I4285c9d6e7df762f697f5ad62fe30b2e6151cdd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 04:04:18 +00:00
Tiffany Nguyen
3fa60efb6c Add Apps > Battery optimization page implementation. am: 6147e0fa5c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19726219

Change-Id: I3498f3c1482acf6ece57bd1297bffd9c08d81c5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 04:04:13 +00:00
Tiffany Nguyen
260c82477c Fix loading bug when switching filters.
Also auto fix some lint issues.

Bug: 243337537
Test: Manual
Change-Id: I55a393517ae01d6a8c17106a3e7750323838cebb
(cherry picked from commit 67599bce4e)
Merged-In: I55a393517ae01d6a8c17106a3e7750323838cebb
2022-09-04 15:49:03 +00:00
Tiffany Nguyen
c2ad30d432 Align strings and UX across the different pages.
https://screenshot.googleplex.com/ercwXXcfg2QHkAW.png
https://screenshot.googleplex.com/AWfsrNWsJUbdF8x.png

Bug: 240711618
Test: Manual
Change-Id: I3d1083a7b50adffb67592b2e42914adf755bd6cd
(cherry picked from commit 1d1b115785)
Merged-In: I3d1083a7b50adffb67592b2e42914adf755bd6cd
2022-09-04 15:48:55 +00:00
Tiffany Nguyen
032649b4f8 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
(cherry picked from commit 3acd34fe4a)
Merged-In: I03d17beac0fb85a3d17acd7d0d581feb35e9582b
2022-09-04 15:48:46 +00:00
Tiffany Nguyen
6147e0fa5c Add Apps > Battery optimization page implementation.
Moving the old restricted page to the new optimization page will happen
in a follow-up CL.

Test: Unit, manual
Bug: 238026672
Change-Id: I5fee9ebe03284a013da6bfca9ada8b166c6af91c
(cherry picked from commit 5ecb1a1d69)
Merged-In: I5fee9ebe03284a013da6bfca9ada8b166c6af91c
2022-09-04 15:44:18 +00:00
Tom Hsu
7ddbff8eca Merge "[Panlingual] Improve conditions of supporting app locale." into tm-qpr-dev am: 12377854b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19674442

Change-Id: I43489e9e2476925c2680b8ec7da335900e0ad106
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 07:25:46 +00:00
Tom Hsu
a18ec335a9 Merge "[Panlingual] Remove featureflag of app language." into tm-qpr-dev am: 34cb6d3237
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19674012

Change-Id: I30906dc1a60949776b27ba6df3fe723f1eed6076
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 07:25:44 +00:00
Tom Hsu
12377854b1 Merge "[Panlingual] Improve conditions of supporting app locale." into tm-qpr-dev 2022-08-25 06:24:12 +00:00
Tom Hsu
34cb6d3237 Merge "[Panlingual] Remove featureflag of app language." into tm-qpr-dev 2022-08-25 06:24:12 +00:00
tom hsu
3aa4440b36 [Panlingual] Improve conditions of supporting app locale.
There are 3 conditions we need to check.
  1. Has locale config file
  2. Has locale config file w/o content
  3. Has locale config file w/ content

 Currently, we do not have condition 2 into the condition group, and we
 need to add it into.

Bug: b/243099750
Test: Manual
Change-Id: I58d0275af53031ba4f4c705022017d5143f45795
2022-08-24 03:39:35 +00:00
tom hsu
e6b46dc853 [Panlingual] Remove featureflag of app language.
Panlingual successfully landed. Hence, we can remove the feature flag
 right now.

Bug: b/209775925
Test: atest pass
Test: Manual test pass
Change-Id: I464a206027fd63ee1763acaf17d1b6251e839bc0
2022-08-24 11:29:31 +08:00
YK Hung
6992c28b4a Merge "Port new version battery usage chart implementation from master to tm-qpr-dev." into tm-qpr-dev am: c586e1e427
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19569019

Change-Id: I69ba753143ff1bb5fab2db8a53785540530e3c77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 01:50:45 +00:00
YK Hung
c586e1e427 Merge "Port new version battery usage chart implementation from master to tm-qpr-dev." into tm-qpr-dev 2022-08-19 01:30:51 +00:00
Kuan Wang
4db5c6ba57 Port new version battery usage chart implementation from master to tm-qpr-dev.
This cl is a merge of the following 36 cls:
ag/19250259	Duplicate BatteryChartPreferenceController and BatteryChartView into new files for better diff review purpose
ag/19279660	Use Mockito 4.6.1 API for BatteryChartPreferenceControllerV2Test
ag/19267975	Add class BatteryLevelData used to parcel the battery timestamps and levels. It behaves as an interface between UI and data.
ag/19289086	Refactor BatteryChartView X-axis labels. Instead of only timestamps, also support any string[] labels.
ag/19238586	Add interpolation for the history data since last full charge loaded from database.
ag/19331746	Return raw history map in function getHistoryMapSinceLastFullCharge.
ag/19308838	In BatteryChartViewV2, use levels.length-1 to replace mTrapezoidCount. So the chartview could show any number of slots as the given levels length-1.
ag/19332266	Add class BatteryDiffData used to parcel battery usage data
ag/19331467	Refactor Battery Chart View State Controll
ag/19358207	Add DataProcessor to process raw history map for UI.
ag/19332276	Add battery chart view model.
ag/19394744	Update trapezoid validation in battery chart view.
ag/19379730	Support daily and hourly battery chartview.
ag/19428426	Improve X axis labels in battery chart (1)
ag/19446215	Improve X axis labels in battery chart (2)
ag/19394745	Add the async task to compute diff usage data and load labels and icons.
ag/19447624	Support showing app usage list for two battery charts
ag/19500907	Updates battery usage messages from last 24hr to last full charge. (Part1: V2 files)
ag/19505324	Update the selected period message in battery chart
ag/19500905	Updates battery usage messages from last 24hr to last full charge. (Part2: non-V2 files)
ag/19510363	Update usage data for EBS app usage list and App usage detail from 24 hours to last full charge.
ag/19523184	Update usage data for EBS app usage list and App usage detail from 24 hours to last full charge.
ag/19534864	Add margin between battery daily and hourly charts
ag/19491093	Always do interpolation for battery level data in daily chart.
ag/19565630	Avoid NullPointerException when batteryLevelData is null.
ag/19561239	Fix b/241872474 Battery usage page will crash when selecting the last hour chart bar, going to app detail page, and going back
ag/19565633	Fix b/241885070: Unexpected texts moving when going back to battery usage page
ag/19534850	New way to draw battery chart axis labels
ag/19561240	Switch Battery Usage Chart from V1 to V2.
ag/19561338	Switch Battery Usage Chart from V1 to V2.
ag/19600174	Fix b/242254055 Battery usage initial screen improvements (long data loading time)
ag/19600284	Fix b/242252080: Add padding space on the top of the battery chart
ag/19647338	Consider usage map valid even if [all][all] is null.
ag/19634227	Use new content uri everytime to avoid cache
ag/19600177	Fix b/242009481: Refine the battery usage chart timestamp label rule
ag/19647337	Fix b/242809981 Charge battery to 100% when battery usage page opened, the chart will refresh, but the app list isn't refreshed in that case.

Test: manual
Bug: 239491373
Bug: 236101166
Bug: 236101687
Fix: 236101166
Change-Id: I7de8d9dcee14627da10752534991f1ec9f616020
Merged-In: I9142c0d4e00dea3771777ba9aedeab07b635fa1a
2022-08-18 10:53:41 +08:00
Treehugger Robot
ac7a368afd Merge "Fix array-related errorprone warnings" am: a93e78f781 am: a89e7aea3b am: cdacabf984 am: 49a0bbc650
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2183972

Change-Id: I9c4c43088154202d5818b29d010f053a7630ec90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 20:29:36 +00:00
Treehugger Robot
a93e78f781 Merge "Fix array-related errorprone warnings" 2022-08-17 18:37:46 +00:00
Cole Faust
a21ac03acb Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ida6513002f8fd845a385924be290b720f06c4748
2022-08-15 18:52:37 -07:00
Julia Reynolds
2a61b3656b Update Bridged app link when NLS access changes
Test: BridgedAppsLinkPreferenceControllerTest
Test: manual; turn an NLS on/off, verify correct disabled state for fields
Fixes: 240461761
Change-Id: Ib5a5365f7477c2a8d620ced2af96ace364b292e2
2022-08-15 17:50:49 +00:00
Yanting Yang
ea6a06c8e8 Check DISALLOW_APPS_CONTROL before performing reset app preferences
When DISALLOW_APPS_CONTROL restriction is enabled, users should not be
able to enable/disable apps, clear app caches and clear app data.

The function of reset app preferences will re-enable the disabled apps,
it can let users bypass DISALLOW_APPS_CONTROL to enable an app disabled
by IT admin to see sensitive information.

To fix this vulnerability, we add a check for DISALLOW_APPS_CONTROL
restriction before users reset app preferences. Once the restriction is
enabled, it will show dialog “Blocked by your IT admin” instead.

Bug: 238745070
Test: Verify change by turning on/off DISALLOW_APPS_CONTROL with TestDPC.
Change-Id: Iffee73cf4952b686a78b4c7aaa54747971337d03
(cherry picked from commit 4356c9c653)
2022-08-12 12:25:48 +00:00
Zaiyue Xue
3b7953eac2 Merge "Move battery usage files to a separate folder." into tm-qpr-dev 2022-06-20 09:12:04 +00:00
xuezaiyue
ac7318419a Move battery usage files to a separate folder.
Bug: 202118250
Test: presubmit
Change-Id: I21aa58ebc02327849ed2161dbbafcdc806c007f2
2022-06-19 05:59:35 +00:00
Jason Parks
3f55cd8929 Merge "Use API to check for the superivion component." into tm-dev am: 73276b3c91 am: 3b6fe0813b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18817832

Change-Id: I0fafd91b14712a6bf9a118a2512973af1fb3d502
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 13:42:02 +00:00
Jason Parks
4a9c108b28 Use API to check for the superivion component.
Bug: 219025233
Test: manual
Change-Id: Icd2593a67ae0297340991a5375b18e2f933facb1
2022-06-14 17:16:07 +00:00
Chaohui Wang
304a3fd37e Merge "Enable Kotlin for Settings App" into tm-qpr-dev 2022-05-30 02:43:23 +00:00
Chaohui Wang
9ec6f0e41a Enable Kotlin for Settings App
Currently Kotlin files cannot build with library app-compat-annotations.

Only one @ChangeId need this library, create separate build target
library Settings-change-ids to solve this issue.

After this cl, Kotlin could be used for Settings App.

Fix: 229037247
Test: make Settings
Change-Id: I4a0d99425c9e6cc2cbc015d2561daa68609ca0fd
2022-05-30 01:58:25 +08:00
Chaohui Wang
6737a44fba Merge "Fix unable to toggle off Pause app activity" into tm-dev am: bc2e0f5fc4 am: caabb4fe49
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18581945

Change-Id: I97d75ae94ed28e05698b516ef7e43d6c638c2b7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 05:48:18 +00:00
Chaohui Wang
2af5588692 Fix unable to toggle off Pause app activity
The "Pause app activity if unused" SwitchPreference under App info page.

Currently, the preference controller updates the UI state in the
onOpChanged(), which is unnecessary and is called in another non-UI
thread.

Not updating state in onOpChanged() to fix.

Note: This controller implements the LifecycleObserver to handle
lifecycle related logic, but it's actually a no-op before change
If9e48e44267de8e89a5e8f45d256719130936320. So it used to work fine
without the OnOpChangedListener, we can remove it now.

Fix: 227762370
Test: manual
Change-Id: I33f1f55a706407d7b409c3544f9889c45855b34d
2022-05-25 11:45:23 +08:00
Tom Hsu
ab7057cb7f Merge "[Panlingual] Fix icon shall have work badage in work profile." into tm-dev am: 883f5e2572 am: 7a69cee691
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18491260

Change-Id: Ia8b4686e81f5d36c4750ec933c737e5e3b128ea5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 17:03:56 +00:00
tom hsu
7e27ecb91e [Panlingual] Fix icon shall have work badage in work profile.
Bug: 233064114
Test: local
Change-Id: I8aa24373f0381b172c30d16aedb2f9ba97238234
2022-05-23 19:34:51 +08:00
Edgar Wang
42704ba27c Merge "Update learn more string of FooterPrefernce" into tm-dev am: 24654a3d61 am: 4d371adf7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18356903

Change-Id: I70547c9094cdd200f1fa2a77272affbcbe308a34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 23:52:43 +00:00
Edgar Wang
24654a3d61 Merge "Update learn more string of FooterPrefernce" into tm-dev 2022-05-20 23:13:07 +00:00
TreeHugger Robot
6a2136b93a Merge "Revert "Show previous query upon configuration change"" into tm-dev am: fea570f524 am: 4ffd6caf54
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18486386

Change-Id: I0c4ea8367b14a7ac81867587cddb97a1152f61ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:05:57 +00:00
Calvin Pan
2552125764 Merge "Avoid getting app locale config for each app" into tm-dev am: 9d6cf4255d am: 4d728de8bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18456663

Change-Id: Ic52667662f873194ff4000b59144fa30223bbc33
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 12:48:28 +00:00
TreeHugger Robot
fea570f524 Merge "Revert "Show previous query upon configuration change"" into tm-dev 2022-05-20 12:27:55 +00:00
Yi-Ling Chuang
e763ca1715 Revert "Show previous query upon configuration change"
This reverts commit d9453bf8c6.

Reason for revert: This introduces a new flicker which doesn't seem good. Will have another solution once all things are ready.

Fixes: 232355879
Change-Id: I0bbc4561ce4fbef36d59de15ae98705a6d81574c
2022-05-20 10:11:20 +00:00
Calvin Pan
9d6cf4255d Merge "Avoid getting app locale config for each app" into tm-dev 2022-05-20 01:52:46 +00:00
Arc Wang
5eb4a3b989 Center apps Preference title when there is no summary am: 3cb8171f4f am: 75eac09a00
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18426345

Change-Id: I9dd27011538e0fce99d33045288e984c6252e853
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 22:39:18 +00:00
Tom Hsu
5156987650 Merge "[Panlingual] Fix the item clicked is not match target application" into tm-dev am: 45c60f8564 am: 6a85746757
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18356600

Change-Id: I96399fbf01ccf5915f263106fbb331b428d1e126
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 22:38:43 +00:00
Calvin Pan
1a253baae4 Avoid getting app locale config for each app
Getting app locale config will spend a lot of time. Removing the log
to prevent getting locale-config for each system app.

Bug: 232557302
Test: Saving about 80% under java stack tracing mode
Change-Id: I2e755286a4e493be7fd73028ade8d190f6571e46
2022-05-18 11:15:46 +00:00
Arc Wang
3cb8171f4f Center apps Preference title when there is no summary
Hide apps Preference summary when a summary is empty
then its title will be vertically centered.

Bug: 229646669
Test: manual visual
      Settings -> Apps -> See all apps
      Settings -> Notifications -> App settings
      Settings -> Storage -> Apps
      Settings -> System -> Language & input -> App Languages
Change-Id: I6fceba243e2ccac9ea180b940b571da07e1ba805
Merged-In: I6fceba243e2ccac9ea180b940b571da07e1ba805
2022-05-17 09:09:08 +00:00
tom hsu
c5bb55689b [Panlingual] Fix the item clicked is not match target application
- Remove unnecessary action of shift poistion.

Bug: b/232754527
Test: local and see b/232754527#2
Change-Id: Ief8655661dd3cc468e68a085dede528694ede33c
2022-05-16 22:42:20 +08:00
KUAN WANG
614d2dfc0b Merge "Reset Optimization Mode of apps when users reset app settings." into tm-qpr-dev 2022-05-16 05:34:47 +00:00
Kuan Wang
4028e6123c Reset Optimization Mode of apps when users reset app settings.
Fix the issue that Optimization Mode is not reset when users click the
"Reset apps" button in the setting.

Bug: 222037028
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge" + emulator
Change-Id: I22fb8aa19e284e11882b2920b77b544dee4cc33c
2022-05-16 05:01:20 +00:00
Yi-Ling Chuang
14d31677d6 Merge "Make sure loading extra info once" into tm-dev 2022-05-16 03:26:30 +00:00
tom hsu
36693d8096 [Panlingual][Settings] Add top intro on the top of app list.
- show a message for app selection of user to avoid any confusion of
   searching app.

Bug: b/230689178
Test: see b/230689178
Change-Id: I597e718b81bd7a5019c69dbdfc02f26d7f3af5fd
2022-05-13 16:31:36 +00:00