Commit Graph

168 Commits

Author SHA1 Message Date
Wesley Wang
eda172ce2c Fix app battery usage list launch incorrect works app
- App usage page only use package name to launch the page, it can not
   identify the different userId between normal app and work profile
   app, add extra userId info into launch args
 - Remove no battery usage state/string if usage time is empty

Bug: 251471047
Test: make SettingsRoboTests
Change-Id: Id06ebb0f0fcd863e423acd7839f89bc0ae2444c1
2022-11-03 11:32:30 +00:00
Arc Wang
12d4b78473 Merge "Extend SearchView width" into tm-qpr-dev am: 049deec9b5 am: 4cfe8b8204
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20337665

Change-Id: I7a3bdcfa520fe402da940e426a89b3ffd2c2b1e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-02 08:41:11 +00:00
Arc Wang
0243771025 Extend SearchView width
To align SearchView x button with right border.

Bug: 254403811
Test: manual,
      Settings > Apps > See all apps > tap the search icon >
      input something and observe.
Change-Id: I5146c9ffb3c5177926e75f673497408092f6c065
2022-11-01 10:26:17 +00:00
Chaohui Wang
3eddcc6703 Add AppLocalePreference for Spa
Also let SettingsSpaUnitTests depends on the
mockito-target-extended-minus-junit4 to support mock static methods.

Bug: 236346018
Test: Unit test & Manual with Settings App
Change-Id: Ib7a3022b20e30c8292713f52d29785eb78899c70
2022-10-26 11:01:47 +08:00
Josh Hou
2c4f8fd26f Merge "[Panlingual] Separate the app locale information by profiles" into tm-qpr-dev am: 9c2e35244d am: b589be652d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20064275

Change-Id: Id41300275c5fa7fde6d688419dc7f4d526ea8da5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 06:07:17 +00:00
Josh Hou
c01034ebd1 [Panlingual] Separate the app locale information by profiles
Fix not seeing apps with the LocaleConfig in the app language selector of Settings.

Bug: 239054437
Test: Manual
Change-Id: I4db78300b63e6fda2890383c097bb46102084d95
2022-10-07 17:24:48 +08:00
Chaohui Wang
3659711fe0 Add AppSettings page
Including the following features,
- App icon
- App label
- Display over other apps item
- Modify system settings item
- Picture in picture item
- Install unknown apps item
- App version

Bug: 236346018
Test: Manual with Settings App
Change-Id: Ieabdd32fac1d0992ba5c22d459631b42a17ce32a
2022-09-20 12:13:36 +08:00
TreeHugger Robot
a36f9483c0 Merge "Update App battery usage page and add tests." into tm-qpr-dev am: 50c7cb834e am: 2f40a918e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19951824

Change-Id: Ic1fb7dc0fc1be41a9497095b4891fe4f1cac2e18
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-16 10:27:28 +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
Chaohui Wang
5f8d383b38 Add PictureInPicture to Spa
Bug: 235727273
Test: Manual with Settings App
Change-Id: I6ef15dd49fd74ba2d59a8e55c0b7a6c2cd1cd928
2022-09-07 15:23:41 +08: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
Chaohui Wang
92c5ef7a89 Navigate to Install unknown apps in SPA
Guarded by feature flag SETTINGS_ENABLE_SPA, default false.
When flag enabled, will navigate to the new "Install unknown apps" page
which is implemented by SPA.

Bug: 235727273
Test: Manual test with Settings app
Change-Id: Ife038e4b2b23520f6cc46075a6bae6282f11f1af
2022-08-31 06:03:06 +00:00
Tiffany Nguyen
67599bce4e Fix loading bug when switching filters.
Also auto fix some lint issues.

Bug: 243337537
Test: Manual
Change-Id: I55a393517ae01d6a8c17106a3e7750323838cebb
2022-08-23 05:54:52 +00:00
Tiffany Nguyen
1d1b115785 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
2022-08-18 17:52:06 +00:00
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
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
TreeHugger Robot
a44044dfe6 Merge "Fix the header can't be scrolling problem in landscape mode" 2022-08-12 07:30:22 +00:00
Yanting Yang
4356c9c653 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.

Fixes: 238745070
Test: Verify change by turning on/off DISALLOW_APPS_CONTROL with TestDPC.
Change-Id: Iffee73cf4952b686a78b4c7aaa54747971337d03
2022-08-11 22:43:38 +08:00
Sunny Shao
151a088094 Fix the header can't be scrolling problem in landscape mode
- Settings header is restricted scrolling by this ag/15029686
- To void some pages can't show the contain part while heading unscrolling.
  We allow the header can be scrolling in the landscape mode.

Fixes: 207353353
Test: make RunSettingsRoboTests -j
Change-Id: Ice97c6244716d4768167feb78588807d13b06a94
2022-08-11 15:33:45 +08:00
Tiffany Nguyen
5ecb1a1d69 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
2022-08-02 18:43:53 +00:00
Binyi Wu
a62e8abcba Hide keyboard when user scroll through App search suggestions
Bug: 236037001
Test: manual
Change-Id: Ifdadc0a20f6ac4d658cea8ddca99044064d0d53f
2022-06-21 10:47:23 +08: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
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
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
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
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
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
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
Yanting Yang
51204e3deb Merge "Fix reset app preferences for work profile apps" into tm-dev 2022-05-10 12:25:59 +00:00
Yanting Yang
ee0931f5ba Fix reset app preferences for work profile apps
In the past, Settings didn't support resetting the disable status of
work profile apps, it doesn’t follow the behavior that the reset dialog
mentioned.

To fix it, we are going to check apps by enabling user profiles and user
id. If the work profile is enabled, we will also reset them when users
select to reset app preferences.

Bug: 187387211
Test: manual
Change-Id: I25fd0129335539a23ed2ee0af57fdd9714eddf74
2022-05-10 07:06:14 +08:00
TreeHugger Robot
036d6744dd Merge "Ensure loading all apps once in ManageApplications" into tm-dev 2022-05-09 08:09:46 +00:00
Mill Chen
fdbf748dc0 Ensure loading all apps once in ManageApplications
Some pages that extend ManageApplications always display a loading
spinner when entering them. This is caused by that it takes over
100 ms to load all apps and to sort the apps. In addition, the task of
loading all apps might be invoked twice, which caused loading time
increasing.

This CL is to make sure the task of loading all apps execute only once
in those pages that extend ManageApplications.

Bug: 222985623
Test: manual test
Change-Id: I3b15bf2eee2a4c220f42da39a29f0014cc620898
2022-05-06 15:55:36 +08:00
Yi-Ling Chuang
d9453bf8c6 Show previous query upon configuration change
Save the query string before configuration changed and set the previous
query string upon the re-create.

Fixes: 204158119
Test: robotest
Change-Id: I48b2a4b272873665a653d2ebc4c02bb99d4b0d0d
2022-05-04 22:22:26 +08:00
Yuri Lin
646e9e4ff8 Move REVIEW_PERMISSIONS_NOTIFICATION_STATE to Global from Secure
This is a global setting that is not per-user, so adjusting it accordingly.

Bug: 225373531
Test: manual
Change-Id: I100cd53a5ffef6ce5f9a01e6add9465a00ceaeb5
2022-04-27 14:31:20 +00:00
Yuri Lin
554ab1fe3e Special handling for intent coming from "welcome" notification.
This notification is an introduction to new notification permission changes in T and is shown to the user upon upgrade; this change records that the user has seen/interacted with the notification already so we don't have to keep showing it.

This change essentially makes a copy of the existing functionality of NotificationAppListActivity, but meant only for access internally (so that neither the activity nor the associated action is exported/publicly accessible).

Bug: 225373531
Test: manual with the change that sends the notification
Change-Id: I20c6084652ea11a8d0a002a21561fe50b9cf5de3
2022-04-14 12:54:56 -04:00
Josh Hou
e32d422d3d [Panlingual] Fix the app language is shown incorrectly in the work profile
The root cause is that the context corresponding to the specified
profile Id is not correctly used when using LocaleManager to query the
app language.

Bug: 222769707
Test: Verify the issue by using the steps provided in the bug
Change-Id: Ic1f9e4cc9e90f5aecfa5e1094184aa63f3d94ffb
2022-04-01 13:00:47 +08:00
Tom Hsu
7eb32dec44 Merge "[Panlingual] Revamp the panlingual UI in Settings." into tm-dev 2022-03-31 08:32:52 +00:00
tom hsu
9be043e750 [Panlingual] Revamp the panlingual UI in Settings.
- Create a Activity to contain AppLocaleDetail and
    LocalePickerWithRegion
  - Update the Entry from apps language page

Bug: 223089715
Test: local test pass
Change-Id: Id01e93f3df32412c7323ca577a149009eb1862ad
Merged-In: Id01e93f3df32412c7323ca577a149009eb1862ad
2022-03-31 03:35:21 +00:00
Arc Wang
e1aeacad6a Fix NullPointerException at ManageApplications$ApplicationsAdapter.access
mApplications may be null and should check if it's null before accessing.

Bug: 217872983
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=ManageApplicationsTest
Change-Id: I97a26e26478eb239370cdef8c44342cd7aeb71ee
2022-03-09 17:52:34 +08:00
tom hsu
ea9e627c1c [Panlingual] Improve UI can not show on at first.
- Settings take much time to get the info of app launcher entry. User
    may not see the panlingual UI at first after boot to home.
  - Does small refactor to somewhere.

Bug: 218416193
Test: local
Test: atest pass
Change-Id: Ibfb91f0bb8d8ff54cadd041250b3cff252dbe591
(cherry picked from commit cae20ce2f7)
Merged-In: Ibfb91f0bb8d8ff54cadd041250b3cff252dbe591
2022-03-03 08:39:20 +00:00
Edgar Wang
fa5ab2e268 Replace SettingsSpinner with Spinner
Bug: 219610512
Test: manual
Change-Id: Ib8562a64299a6cb36f8225199f9432cb81e8e9f2
2022-02-17 02:16:27 +08:00
Jonathan Scott
c3dbc3ffbd Merge "Allow Device Management Role Holder to update Settings strings." 2022-01-31 19:10:30 +00:00
Yanting Yang
19bdc6ce67 Apply a new icon cache mechanism for memory improvement
- Avoid loading all app icons at once to decrease memory usage.
- Only load visible icons when entering the apps page.
- Reserve icon placeholder to alleviate icon loading flicker.
- Release icon cache when low memory or leaving apps page.

Bug: 187118427
Bug: 209898662
Test: manual check the smoothness and memory usage of apps pages.
Change-Id: Ifc3c2a73cc88d6e42739df4e8208445afa12e0ea
2022-01-27 17:20:58 +08:00