Commit Graph

450 Commits

Author SHA1 Message Date
Sunny Shao
b0885a155a Add a feature flag for SPA metrics
- Add a new SETTINGS_ENABLE_SPA_METRICS flag.

Fixes: 277540990
Bug: 253979024
Test: atest SpaActivityTest SpaLogDataTest MetricsDataModelTest
Change-Id: I6da801691fd34fd133ec25d3a45ed6124bec51a1
Merged-In: Iba7a44715cf6ba78c3b84d559faf71a0be33d8d3
2023-04-12 21:38:40 +08:00
Treehugger Robot
568ba14b9b Merge "Fix App languages for work profile" into udc-dev 2023-04-12 09:35:32 +00:00
Chaohui Wang
4388e217d8 Merge "Display App installed in other user in All Apps" into udc-dev am: 4c1e924442 am: 03e8ebc4dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22546422

Change-Id: Ifa44a57f688fcbac11a4c77942a74d1cabc395ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 06:04:32 +00:00
Chaohui Wang
4c1e924442 Merge "Display App installed in other user in All Apps" into udc-dev 2023-04-11 04:02:39 +00:00
Treehugger Robot
825450f1b8 Merge "Ignore ActivityNotFoundException from app launch" into udc-dev am: 35f9d486a5 am: 227b55d8c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22347563

Change-Id: I442e08f1badd0ff0570df968a683c0b2228bb177
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-10 08:04:09 +00:00
Treehugger Robot
35f9d486a5 Merge "Ignore ActivityNotFoundException from app launch" into udc-dev 2023-04-10 06:48:17 +00:00
Chaohui Wang
9661f163c3 Fix App languages for work profile
Use the correct work profile context to fix.

Fix: 277536202
Test: Manually with App languages when work profile is installed
Change-Id: Ibc3bb47127228c8dc6ebf073cd7881727321d5c8
2023-04-10 13:32:24 +08:00
Chaohui Wang
c688f93ed9 Display App installed in other user in All Apps
Only for admin user.

Also clean up unused getInstallationStatus().

Fix: 277299765
Test: Manually with All Apps when multiple users is on
Test: Unit test
Change-Id: I4de681c101a605e3517dcd8765bf7a95d1b76417
2023-04-10 03:06:01 +08:00
TreeHugger Robot
4c0a765528 Merge "Fix App battery usage crash" into udc-dev am: d25bd214ae am: 7232cf4cc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22414534

Change-Id: Id32990d545c33ec89cf604d56ec2d7d732993f15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-04 05:30:36 +00:00
Chaohui Wang
ecd8ffb08b Fix App battery usage crash
userContext.getApplicationContext() returns null, which cause crash.

Use context instead to fix.

userContext was used to support multiple profiles, since the app's user
id is also passed to getAppBatteryUsageData(), userContext is not need.

Fix: 269545838
Fix: 275957358
Test: Manually check the battery usage is still correct if an app is
      installed on two profiles
Change-Id: I41a80e4c6edc338affb6eec0cf12da3c438cd7fd
2023-04-04 00:15:29 +09:00
Chaohui Wang
f8adb7dca7 Ignore ActivityNotFoundException from app launch
Only happens after package changes like uninstall, and before page auto
refresh or close, so ignore this exception is safe.

Fix: 276023155
Test: Click the open button ASAP after uninstall an app from App Info
Change-Id: I62314fda0947dee5e05263d1079ff422688527c3
2023-03-30 21:41:30 +09:00
TreeHugger Robot
73f8cb55b1 Merge "Correct the disable button text" into udc-dev am: 107690cb55 am: f04f7fcf52
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22307475

Change-Id: I6a2078c1eb99692b75b73e0f757c8a6491e217a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 02:13:08 +00:00
Chaohui Wang
ac9735457d Correct the disable button text
This is a type before, use the correct string resource.

Also remove the title to align with before SPA migration.

Fix: 275344620
Test: Manually with Settings
Change-Id: Id80cd1e3e7092cb645cb6ccb563e8fd11c5a40e5
2023-03-28 23:12:47 +09:00
Josh Hou
5139a9b98c Merge "[Panlingual] Can't set per-app languages for apps on work profile page" into udc-dev am: b1f9d26174 am: f8a3717611
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22173332

Change-Id: I39e37e5f705ef0934aa740e3f1bef1ba12fcd58b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-22 07:28:46 +00:00
Josh Hou
b1f9d26174 Merge "[Panlingual] Can't set per-app languages for apps on work profile page" into udc-dev 2023-03-22 05:14:47 +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
Chaohui Wang
5fc73ac4b0 Merge "Fix not displaying "Allow restricted settings"" into udc-dev am: ac67b77af7 am: 989a724787
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22135265

Change-Id: Ifca2b640e3963bbc365ad10e5be14db954f891ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-20 23:27:53 +00:00
Chaohui Wang
90983daa41 Fix not displaying "Allow restricted settings"
"Allow restricted settings" is missed from SPA, added to SPA to fix this
issue.

Also make the system call in app info more options async to improve
performance.

Fix: 273678047
Test: Unit test
Test: By the following steps,
1. Install an app with accessibility feature from Chrome
2. Go Accessibility page and click on the disabled grey app
3. Go to the app info page, click more options
4. Make sure "Allow restricted settings" is displayed

Change-Id: I4adbe2335a32e6a7c4ebe155715684d768e5d1ef
2023-03-20 19:40:06 +08:00
Chaohui Wang
8b31ed172e Merge "Move LogEvent action to Settings" into udc-dev am: ba39aa506b am: 4b86d5df4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22067164

Change-Id: I40bbed089befb8e3abaa080aa792fb06770727c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 06:55:41 +00:00
Chaohui Wang
4b964aa552 Move LogEvent action to Settings
Spa cannot refer SettingsEnums, move the action to Settings.

Bug: 269821172
Test: Make Settings
Change-Id: I033f4d046736b109de679e139caac75b3e4071b1
2023-03-14 16:46:47 +08:00
Ankita Vyas
18fc54b53e Merge "Display toast for clone app creation and completion in App Info page." into udc-dev am: f9c62f2275 am: 9dc72b2f94
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21809544

Change-Id: I34a93564916fac6f74e2097cbe5dea508ac3a235
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-09 06:16:52 +00:00
Ankita Vyas
f9c62f2275 Merge "Display toast for clone app creation and completion in App Info page." into udc-dev 2023-03-09 05:10:55 +00:00
Ankita Vyas
0da1131343 Display toast for clone app creation and completion in App Info page.
Bug: 271990959
Test: manual
Change-Id: I93641c1bf675ac531fbf8201203d5141aafd39cc
2023-03-08 10:55:37 +00:00
Sunny Shao
cc7eeb6f55 Merge "Add the SPA page enter/leave logging metrcis." into udc-dev am: cb24cb29db am: f336246896
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21787864

Change-Id: I6b1d8d7d542891f55aa42224682d473ca086cf0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 10:40:00 +00:00
Sunny Shao
de797e1198 Add the SPA page enter/leave logging metrcis.
- Add the SpaLogProvider and SpaLogData for logging writing.
- Write the SPA page enter/leave logging.

Fixes: 271793388
Bug: 253979024
Test: atest SpaActivityTest SpaLogDataTest MetricsDataModelTest
Change-Id: I0ad5af39ba207ac00d58f6392496effa3adc42f4
2023-03-07 16:10:56 +08:00
Chaohui Wang
06f806f6cd Merge "Fix App Info item summaries not refreshed" into udc-dev am: f74d6003ff am: bd1715e012
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21647180

Change-Id: I54cf0d02cc52b8c42f61585ddc62b580b95b628a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 06:50:45 +00:00
Chaohui Wang
f74d6003ff Merge "Fix App Info item summaries not refreshed" into udc-dev 2023-03-01 05:47:06 +00:00
Chaohui Wang
66c1337ec4 Merge "Disable the middle pages during development" into udc-dev am: e34d95d68e am: 55204b9224
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21469909

Change-Id: Icf7c6ef483b9f2e535dac154c7aae5b10810d03b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 19:56:33 +00:00
Chaohui Wang
e34d95d68e Merge "Disable the middle pages during development" into udc-dev 2023-02-28 11:43:05 +00:00
Chaohui Wang
f46cdad05d Fix App Info item summaries not refreshed
On tablet, "Open by default" & default app shortcut not refreshed when
settings changed.

Changing from liveData to flow fix this issue on tablet.

Bug: 236346018
Test: Manually with App Info
Change-Id: I6e3a174bdbecb154e39e111ecf695b1146c484df
2023-02-28 19:37:55 +08:00
Zaiyue Xue
c6166bc07d Merge "Fix b/265387286: The total percentage of all apps is not 100%" into udc-dev am: ae0d935dcc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21502689

Change-Id: Ib0c1ebd27bc65db95fccae3a67514b7687d662b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 13:31:35 +00:00
Zaiyue Xue
6d939b34dc Fix b/265387286: The total percentage of all apps is not 100%
Bug: 265387286
Fix: 265387286
Test: manual
Change-Id: I654f8211a45c818f9a2d4867ac679e72c9ce6eb1
2023-02-24 19:19:28 +08:00
Chaohui Wang
eb26875a32 Merge "Update HomePageProvider to use getSettingsPage" into udc-dev am: 6461dc3814
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21489365

Change-Id: Ice4d96f8ab8420448f53ffa7da62cbedcb3a30cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-22 02:46:01 +00:00
Chaohui Wang
048cf57157 Update HomePageProvider to use getSettingsPage
Bug: 244122804
Test: Manually with Settings
Change-Id: I57123d3b5461c06e021ab0ccacc94ce8447d1f43
2023-02-18 03:02:04 +00:00
Carbo Kuo
bd18ca11d0 Merge "Migrate the About page in Settings." 2023-02-17 16:32:54 +00:00
Chaohui Wang
f37d638458 Disable the middle pages during development
Set isEnabled to false will prevent these middle pages which under
development get accidentally displayed to users.

During development, please flip isEnabled() of each page to true or
flip SpaEnvironment.IS_DEBUG to true to test these pages.

Bug: 244122804
Test: Manually with Settings
Change-Id: I5c3f835cfa3457b711d224ca37aa5d2b9a248feb
2023-02-17 06:16:09 +00:00
Carbo Kuo
107d7fc5c6 Migrate the About page in Settings.
This change adds the "About" page and the "Device name" Preference.

However, due to the lack of editable text support in the alert dialog (SPA widget), the device name can't be changed at the moment.

Bug: 269486170
Test: manual, see screenshots.
Change-Id: Ie6b034d82b1718c8f22366ef525fd6d36e4df9ad
2023-02-16 18:14:36 +00:00
Zoey Chen
e6b32b7d3d [SPA] Move the network folder to spa/
Bug: 268144349
Test: manual
Change-Id: I97dcd047a35ff94f5f6bb7c304a81679f72b10a4
2023-02-14 11:39:18 +00:00
Zoey Chen
405aa17b8a [SPA] Add new entry: Network & Internet and Airplane mode
Network & Internet
Screenshot: https://hsv.googleplex.com/6109427053625344

Network & Internet > Airplane mode
https://hsv.googleplex.com/5087887067447296

Bug: 268144349
Test: manual
Change-Id: Ifc6e8db86a5511af7e43394a3f5e356dfadcfe89
2023-02-09 13:50:28 +08:00
Lyn Han
0a79769c15 Merge "Settings page to manage FSI permission" 2023-02-07 22:52:09 +00:00
Chaohui Wang
cd6946ca5b Merge "Always use Spp to generate SettingsPage in Settings" 2023-02-02 09:11:45 +00:00
Chaohui Wang
8fcf4d0715 Always use Spp to generate SettingsPage in Settings
Bug: 244122804
Test: Manually with Settings
Change-Id: I3625d34abcdfd3f7264e20e94043769f1f9ed699
2023-02-02 15:21:03 +08:00
Lyn
685f1e4771 Settings page to manage FSI permission
Apps > Special App Access > Manage Full Screen Intents > App Specific page

Follows new Settings Platform Architecture that the Settings team
is migrating to for UDC.

Bug: 243421660
Test: make SettingsGoogle -j40
adb install -r out/target/product/$TARGET_PRODUCT/system_ext/priv-app/SettingsGoogle/SettingsGoogle.apk

Change-Id: Id2ca18480ddf788bee18b67a3689ef9593059a24
2023-02-02 05:36:52 +00:00
Chaohui Wang
e4c9959fd7 Add AppPermissionPreferenceTest
Unit test for AppPermissionPreference.

Bug: 236346018
Test: Unit test
Change-Id: I83e19bd8d4d667fb6cb2be8aed85ba7f0a8f149e
2023-02-02 13:34:09 +08:00
Chaohui Wang
750c6072b9 Use SettingsAlertDialog for app button dialogs
Use the spa standard widget SettingsAlertDialog to unify the dialog
style.

Bug: 236346018
Test: Manually with Settings
Test: Unit test
Change-Id: Idb231600e38ec7b0244baa5101da912ed2b9fd3c
2023-01-31 17:42:39 +08:00
Chaohui Wang
c1726d07e5 Launch the correct profile for the App Info items
Use the app user handle when SubSettingLauncher launch the new page, to
make sure the new page is opened for the correct profile.

Bug: 236346018
Test: Unit test
Test: Manually with App Info Setting page
Change-Id: Idd6eb183e967b1ced10fcf46b9e74bdff3953280
2023-01-29 01:10:47 +08:00
Ankita Vyas
5fc8308173 Merge "AppClone: Few fixes in Cloned Apps page." 2023-01-20 04:39:19 +00:00
Ankita Vyas
48279a0d72 AppClone: Few fixes in Cloned Apps page.
- Trigger uninstall as clone user
- Back navigation

Test: manual
Bug: 259022623
Change-Id: Ic9e0b20d371f6f0a5c70c84b3950e82ba43bc82e
2023-01-19 08:53:39 +00:00
Steven Lee
546d49c3df Make toggle permission provider list in SettingsSpaEnvironment extendable.
Legal tracker bug: 262937731
Privacy tracker bug: 262936913
UX tracker bug: 262938050

Bug: 259436697
Bug: 263163538
Test: Settings builds.
Change-Id: Ida26f11b101d49375bad85380458b018060d9fec
2023-01-18 12:13:00 +08:00
Kuan Wang
96aee4896b Not show time information in battery optimization page when opened from
Settings -> Apps

Test: make RunSettingsRoboTests + manual
Bug: 265130434
Change-Id: Ie7ae6a97041f490e81adbe8e0c530799e09a7c66
2023-01-16 12:07:07 +08:00