Commit Graph

163 Commits

Author SHA1 Message Date
himanshuz
dd26189e2c Enabling App Cloning Device Config flags by default. The features will be guarded *only* by config overlays, which are off by default.
Bug: 253449368
Test: Manual by building and flashing
Change-Id: I9099019f2bd982588f12ac1741fce27d24e5849e
2023-04-28 11:10:14 +00:00
Josh Hou
38df174bba [Panlingual] Can't set per-app languages for apps on work profile page
Use startActivityAsUser instead of startActivity API to start the AppLocalePickerActivity of different users

Bug: 274378136
Test: 1. Perform AppLocalePickerActivityTest robolectric test
      2. Perform the manual test by switching different users
      3. Perform the manual test by switching different profiles
Change-Id: I4405b3b7e832b71b9ef66fa71d9e42ce12da167c
2023-03-21 10:57:42 +00:00
Alex Johnston
2747dc6e8c Implement OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS exemption
OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS details:
* An app with this appop will be made exempt from all
  power restrictions, including app standby and doze.
* In addition, the app will be able to start fgs from
  the bg, and the user will not be able to stop fgs
  run by the app.

Changes:
* Implement the OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS

Bug: 246330879
Test: atest PowerAllowlistBackendTest

Manual testing:
- Give OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS appop to TestDPC app
- Verify the app can start fg services from the bg
- Verify fgs started by the app cannot be stopped
- Verify the app cannot be put into background restricted via Settings

Change-Id: If9e76076c59195f1e6e5f3eee3c8e7a0c754d8de
2023-02-10 13:37:38 +00:00
George
2c5d1f8d29 Adding Nfc Tag App Preference setting to special_access settings
In the settings app, allow users to change the preference of the Nfc Tag apps.

Bug: 244272155
Test: make RunSettingsRoboTests ROBOTEST_FILTER=NfcTagAppsPreferenceControllerTest
Change-Id: I28903fae8935613a0e8618da21ca44e98b8801d5
2023-02-01 14:10:04 +08:00
Ankita Vyas
7bad1241a4 AppClone: Add animation and description text in Cloned Apps page.
Bug: 265251138
Test: manual and robo
Change-Id: I623c01fc74c1ac162917fce8b2fda9754b0a2b4b
2023-01-13 08:12:18 +00:00
Ankita Vyas
149cbf04aa Merge "AppClone: Changes in AppInfo page for cloned app." 2023-01-12 05:04:43 +00:00
Ankita Vyas
3672fb4b85 AppClone: Changes in AppInfo page for cloned app.
- Hides preferences for cloneable apps under Cloned Apps page
- Displays Create option for cloneable apps under Cloned Apps page.
- Invokes CloneBackend on click of create and refreshes to display newly
  cloned app's AppInfo page.
- Appends suffix 'clone' for cloneable/cloned app.
- Displays text 'Delete' instead of 'uninstall'.

Screencast: https://screencast.googleplex.com/cast/NjI3MDEyMjk1MzAxNTI5NnxhOTIxZDhiZC03Zg

Bug: 262375058
Test: make RunSettingsRoboTests -j64

Change-Id: I34018f6cc7420d2667c25fbca59c832b398d723e
2023-01-06 08:31:20 +00:00
Himanshu Gupta
1648d68d49 Adding "Delete all App Clones" option on Cloned Apps page.
This option is seen by clicking the '3-dot' menu on Settings->Cloned Apps page and requires:
1. Flag 'remove_all_cloned_apps' to be turned on.
2. Cloned UserId to be present in system.

Test: Manually setting the flag, creating clones.
Change-Id: I83ff40923f7932ed6b23cb831bdcd2cb9252d295
2022-12-23 10:58:54 +00:00
Ankita Vyas
5784198b56 AppClone: Implement clone backend flow
- Add onClick listeners of add/trash icons on Cloned Apps page
- New layout with ImageView(Add icon) and ProgressBar
- Creation of clone user and install package in clone user
- Uninstallation of cloned app
- Summary when app is being cloned and after clone completion
- Action metrics

Bug: 259022623
Test: make RunSettingsRoboTests -j64
Change-Id: Idc76fb8d88ba8987084beef2a0ce4c57d6c45b9e
2022-12-19 06:15:10 +00:00
Arc Wang
c3ccc6a20d Merge "Fix flickering before transition animation of app search" 2022-11-29 06:01:39 +00:00
Arc Wang
3b80540e37 Fix flickering before transition animation of app search
ApplicationState.Session must be aware of ManageApplications
lifecycle to correctly activate/deactivate.

Bug: 245877468
Test: manual visual
      Settings -> Apps -> All apps -> search -> click search item
Change-Id: Ia4e6da0c4e43dcd53f6b4ea3e2fa6ffec059b880
2022-11-29 04:03:30 +00:00
Ankita Vyas
3bdedc2add Merge "AppClone: Changes to display app list on Cloned Apps page." 2022-11-28 15:41:37 +00:00
“Ankita
d3019d3ee0 AppClone: Changes to display app list on Cloned Apps page.
- Filers app list
- Displays preference summary
- Display two-target view
- Display header text
- Metric for cloned app page
- Adds bridge class
- Disable "Show system" option

Bug: 259021576
Bug: 249916469
Test: make RunSettingsRoboTests -j64
Change-Id: Idcf213325ead9e298eb3e958b286adcd4c06c8d5
2022-11-28 11:58:19 +00:00
TreeHugger Robot
30a5eaaf3b Merge "Update page id for modify system settings page" 2022-11-22 16:21:01 +00:00
Mill Chen
8ed5b17724 Update page id for modify system settings page
Modify system settings page is using the page id of display over other
apps. Each page should have its own page id, so creating another one for
modify system settings page.

Bug: 260056090
Test: manual test
Change-Id: I4e25734c551f166a0c080eb534d22aea881242d9
2022-11-22 18:31:02 +08:00
Chaohui Wang
5177d070e5 Calculate list type first in ManageApplications
Currently, list type is calculated in onCreate(), and will default to
LIST_TYPE_MAIN if the class name is not set to any special activity.

When adding new app list to onCreate(), but not changing
getSpaDestination() could led to issue when spa is on.

Calculate list type first in onAttach() as single source of truth could
solve this issue.

Bug: 235727273
Test: Manually with Settings with / without spa
Change-Id: If8a3d61cfd08d7d67e32253c3ac7266e5e9e7b4c
2022-11-21 13:02:12 +08:00
Varun Shah
b33256a0fc Add a new special app access screen for long background tasks.
This new screen shows apps that hold the new RUN_LONG_JOBS permission.

Also add a reference to this screen in an app's info page under the
"Advanced" section for apps that have requested this permission.

Bug: 255821578
Test: atest AppFilterRegistryTest
Test: make -j RunSettingsRoboTests \
ROBOTTEST_FILTER="LongBackgroundTasksDetailsTest|
LongBackgroundTasksDetailsPreferenceControllerTest"
Test: visually via the Settings page

Change-Id: Idc498e52d29abc6df757c35e8bc91f00de92ba4a
2022-11-18 07:14:12 +00:00
TreeHugger Robot
e1be0e41ba Merge "Monitor the page scrolling jank for app list pages" 2022-11-11 22:00:11 +00:00
Yanting Yang
9f6c5bdadc Monitor the page scrolling jank for app list pages
Bug: 254237663
Test: take the trace and check the cuj section name
Change-Id: Id9b7affcad354c43c1e8934d81abd1bb51fb2956
2022-11-11 10:59:33 +00:00
Ankita Vyas
64191fe9b1 Merge "AppClone: Add new tab only if any user handle has the property set." 2022-11-11 07:17:49 +00:00
“Ankita
d3ea0f098e AppClone: Add new tab only if any user handle has the property set.
This will ensure that a new tab is not created for clone profile. The
existing behavior of creating work tab when managed profile is present
on device remains as-is.

Bug: 248204976
Test: manual (verfied with primary, clone and managed profile present on
device at the same time)
Test: make RunSettingsRoboTests -j

Change-Id: I116a0de69c51e90aa59fdb47e904c567e5d62102
2022-11-10 10:05:44 +00:00
Chaohui Wang
a2c045a717 Navigate more App List to SPA
Guarded by feature flag SETTINGS_ENABLE_SPA, default false.
When flag enabled, will navigate to the new App List pages
which are implemented by SPA.

Bug: 235727273
Test: Manual test with Settings app
Change-Id: I1905a92dd19f04c46476ce3157897ea609e590df
2022-11-08 10:56:54 +08:00
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
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
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
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