Commit Graph

69 Commits

Author SHA1 Message Date
Chaohui Wang
fb8200aef8 Merge "Add ResetAppPreferences to AllAppListPage" 2022-11-30 06:55:46 +00:00
Chaohui Wang
18f8143cae Merge "Add tests for PackageInfoPresenter" 2022-11-29 02:06:36 +00:00
Zekan Qian
bfac23fca3 Cleanup setIsAllowSearch in Settings Spa pages
Bug: 244122804
Test: unit-test
Change-Id: Ib690baf0d8cb669e4e58848c78f2848d40314dc0
2022-11-29 09:21:12 +08:00
Chaohui Wang
6d19ecdb5a Add tests for PackageInfoPresenter
Bug: 236346018
Test: Unit test
Change-Id: Id5e52b6be551044b4b026fb171292decb9ef946f
2022-11-28 20:31:27 +08:00
Chaohui Wang
d70dbe408a Fix flicker of AppButtons
Also remove check for isSystemModule(), since it's also covered by
AppUtils.isMainlineModule().

Bug: 236346018
Test: Unit test
Test: Manually with Settings
Change-Id: Icf8245145a2b2af98847db6040b9e5e930788d4f
2022-11-28 16:30:37 +08:00
Chaohui Wang
2cc51c1685 Add ResetAppPreferences to AllAppListPage
Fix: 259520506
Test: Unit test
Test: Manually with Settings
Change-Id: I3cbd1171df7e6bfcac6b9ebf4901e36fc2d7b14f
2022-11-28 13:39:09 +08:00
Chaohui Wang
3b05ba6da8 Add restriction to AppInfoSettingsMoreOptions
The DISALLOW_APPS_CONTROL restriction.

Bug: 259492166
Test: Unit test
Test: Manually with Settings
Change-Id: Id92e36194201412a0d5cad71410c08508a3b8aaa
2022-11-28 13:30:57 +08:00
Chaohui Wang
1b763b188d Use isEssentialPackage instead of isSystemPackage
This is faster, and we also no longer need to load the PackageInfos with
the deprecated flag PackageManager.GET_SIGNATURES.

Bug: 235727273
Test: Unit test
Test: Manually with Settings App
Change-Id: Ia09ed24ca2622a162ce6008fcd29a930812dbcc2
2022-11-18 13:49:51 +08:00
Chaohui Wang
271d59bec4 Update for MoreOptionsAction
Bug: 259492166
Test: Manually with Settings
Change-Id: I0b0b570a456d9464043a221a628ed33c19d780df
2022-11-17 13:05:12 +08:00
Zekan Qian
8cf80a1227 Use default Page() function in spa.HomePage
Bug: 244122804
Test: build Settings
Change-Id: I700ad8d91ef6c204a3cea06ec02b40c70bb4b942
2022-11-14 13:25:53 +08:00
Chaohui Wang
a9575edf2f Merge "Update for DisposableBroadcastReceiverAsUser" 2022-11-12 03:55:01 +00:00
Chaohui Wang
cfa01cd5b1 Update for DisposableBroadcastReceiverAsUser
Bug: 235727273
Test: Manually with Settings
Change-Id: I597aac55b9ff7667227e9b05e83d804a134b9aaf
2022-11-11 10:49:29 +00:00
tom hsu
8bd5e2a52f [Panlingual] Improve performance of displaying app list in Settings.
- Use existed ApplicationInfo to get needed info.
 - Add unittest to AppLocaleUtil.java

Bug: b/238054165
Bug: b/231904717
Test: Maunal test passed
Test: atest passed
Change-Id: I23f354c366b45d4b684184b3366aeab913bcd3c8
2022-11-11 14:25:19 +08:00
Mill Chen
650fbce5d8 Add description for app languages page
Bug: 236346018
Test: manual test with Settings app
Change-Id: I011957a321ad8c26743e72cc7ce825d06dab9167
2022-11-09 12:47:36 +08:00
Chaohui Wang
33033fe755 Add InstantAppDomainsPreference for Spa
To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One Instant App] -> Supported links

Bug: 236346018
Test: Unit test
Test: Manually with Settings App
Change-Id: I344ddb9c2f3dbc47d38554bf45f04ca7c26c0e5f
2022-11-03 16:27:42 +08:00
Mill Chen
0ee710cddd App language migration
Implement current app language page using spa arch.

Bug: 236346018
Test: manual test with Settings app

Change-Id: I3d3c97304a381acec9d9ef0c27bd047a40ffc4a8
2022-11-02 13:29:15 +08:00
Chaohui Wang
49b7ebeb23 Add InteractAcrossProfilesDetailsPreference for Spa
To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One App] -> Connected work & personal apps

Bug: 236346018
Test: Unit test & Manual with Settings App
Change-Id: I4145ffdb46da6e0c4b7b5103207e7b75a8bbfb6a
2022-10-31 19:25:48 +08:00
Chaohui Wang
f73b79b841 Add AppAllServicesPreference for Spa
To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One App] -> All services

Bug: 236346018
Test: Unit test & Manual with Settings App
Change-Id: Ie491945c36487a5cea3fc64ad6108f3aa492b3b6
2022-10-31 15:51:46 +08:00
Chaohui Wang
5396d8a129 Merge "No show AppButtons for system modules" 2022-10-31 05:08:02 +00:00
Zekan Qian
4c1b702c4f Add Context in SpaEnvironment
Bug: 244122804
Test: manual - build Settings
Change-Id: I92b0e69a880d280776ab7f482aad3e06c72c3c03
2022-10-31 09:56:56 +08:00
Chaohui Wang
85cb46094c Merge "Add AppSettingsPreference for Spa" 2022-10-28 12:53:12 +00:00
Chaohui Wang
5a89763503 Merge "Add AppDataUsagePreference for Spa" 2022-10-28 12:52:57 +00:00
Chaohui Wang
56c9bfed08 No show AppButtons for system modules
To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps (Show system) -> Bluetooth

Bug: 236346018
Test: Unit test & Manual with Settings App
Change-Id: Ibdf5f1ec9f69beefe47fb7a046b0192a73e71b27
2022-10-28 15:56:18 +08:00
Chaohui Wang
aafdb3bfbc Add AppSettingsPreference for Spa
This is used in new App Info page.

To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One App] -> Additional settings in the app

Bug: 236346018
Test: Unit test & Manual with App Info page
Change-Id: I40a175d771c4c0f13986f8c615169c99ce1b0623
2022-10-28 07:41:24 +00:00
Chaohui Wang
dbead03b6a Add AppBatteryPreference for Spa
This is used in new App Info page.

To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One App] -> App battery usage

Bug: 236346018
Test: Unit test & Manual with Settings App
Change-Id: I4784e42f230534d8d843ec00de51032baffcb7e2
2022-10-28 11:18:21 +08:00
Chaohui Wang
601124517a Add AppInstallerInfoPreference for Spa
This is used in new App Info page.

To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One App] -> App details

Bug: 236346018
Test: Unit test
Change-Id: Ibd1ae27c60a096b7f12ca6640a58b099dcfb0b6b
2022-10-27 20:19:17 +08:00
Chaohui Wang
9ee43c96d3 Add AppDataUsagePreference for Spa
This is used in new App Info page.

To try:
1. adb shell am start -n com.android.settings/.spa.SpaActivity
2. Go to Apps -> All apps -> [One App] -> Mobile data & Wi-Fi

Bug: 236346018
Test: Unit test & Manual with Settings App
Change-Id: I1ebcc2c5197eef0c35a2b188b7edb3594fa4ae2a
2022-10-27 11:16:57 +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
Chaohui Wang
af97082f9b Add HibernationSwitchPreference for Spa
Bug: 236346018
Test: Manual with App Info page
Test: Settings Unit tests
Change-Id: I23140a2a16b3b5a4b569623504b1838a641611fe
2022-10-25 09:08:14 +08:00
Chaohui Wang
a8e19e0f2c Add DefaultAppShortcuts for Spa
Including the following,
- Home app
- Browser app
- Phone app
- Emergency app
- SMS app

Bug: 236346018
Test: Manual with App Info page
Test: Settings Unit tests
Change-Id: I4ceb31ed521b758a6f91d7e86fd34c780442b1ac
2022-10-21 15:43:12 +08:00
Chaohui Wang
6d39e5c911 Add AppOpenByDefaultPreference for Spa
The "Open by Default" in App Info page.

Bug: 236346018
Test: Manual with App Info page
Test: Settings Unit tests
Change-Id: I20f827241ff46bca28440b56fd32a0712ee439f9
2022-10-20 17:28:46 +08:00
Chaohui Wang
402744eb36 Add AppButtonRepositoryTest
Bug: 236346018
Test: Unit test
Change-Id: I174bad92ef5357ba0ea0e32cb0435d700a11dc51
2022-10-19 19:55:01 +08:00
Chaohui Wang
b2fdc25a6e Add AppTimeSpentPreference for Spa
Bug: 236346018
Test: Manual with App Info page
Test: atest SettingsSpaUnitTests
Change-Id: Ia707dc57222797536861a7366a31aafaf91b677b
2022-10-14 00:14:39 +08:00
Chaohui Wang
bb4d0250bb Add AppStoragePreference for Spa
Also add new SettingsSpaUnitTests.

Bug: 236346018
Test: Manual with App Info page
Test: atest SettingsSpaUnitTests
Test: Manual compare generated Settings AndroidManifest.xml
Change-Id: I9f6b2ca446fd3d196792a876a6e4049c5cf97a1d
2022-10-13 17:21:08 +08:00
Zekan Qian
99b2bffe53 Merge "Unsupport DebugActivity & EntryProvider in Settings." 2022-10-13 09:11:59 +00:00
Zekan Qian
430ed29262 Unsupport DebugActivity & EntryProvider in Settings.
Set SpaEnvironment (with Spp only) in SettingsApplication
Remove DebugActivity & EntryProvider from Settings.

Bug: 244122804
Test: manual - build Settings
Change-Id: I18e97c80b4f1d6094bb22cf28e7e84ea325869d7
2022-10-13 12:53:48 +08:00
Chaohui Wang
d44e2ad3f6 Rename AppSettings to AppInfoSettings for Spa
To align with current naming.

Bug: 236346018
Test: Make Settings App
Change-Id: I20b2423faf5ee433a530e6a963dd6bb3de33ba90
2022-10-12 19:00:59 +08:00
Chaohui Wang
4357589771 Use getStorageSize from SpaPrivilegedLib
Bug: 236346018
Test: Manual with "All App" App List
Change-Id: If05f334eea365f23e8fc7d7452aed4603c9cdc30
2022-10-12 14:47:28 +08:00
Chaohui Wang
2b11c1fe12 Add AppPermissionPreference for Spa
This is the permission preference in the App Settings page.
The summary is single line.

Add the first Kotlin Robolectric Test for Settings, since Kotlin is not
directly supported by the Robolectric test, using a Java class as a
wrapper.

Bug: 236346018
Test: Manual with App Settings page
Test: Robolectric Test
Change-Id: Ic5a4f7d965885a9cd143428a8cd1900981e316a9
2022-10-11 09:15:26 +00:00
Chaohui Wang
4e35f2596b Apply restricted by admin to the disable button
Currently, we apply the same device policy for both the uninstallation
and disable button.

Also, not double check whether a package is admin (device owner or
profile owner).

Bug: 236346018
Test: Manual on App Settings page
Change-Id: If081fd8ff5422eeac931076a18f73632132a528c
2022-10-09 13:09:40 +08:00
Chaohui Wang
9b65b1583d Add uninstall updates & uninstall for all users
These are the items in the more options of App Settings page.

Uninstall updates only shows up for updated system app.

Uninstall for all users only shows up for primary user when a non-system
app is installed on multiple users.

Bug: 236346018
Test: Manual on App Settings page
Change-Id: I7530ce5215ed921c0a2b767dce56cbfd9a2b0137
2022-09-29 13:20:03 +08:00
Chaohui Wang
7075bc4faa Merge "Add install & clear app button for instant app" 2022-09-29 03:10:43 +00:00
Chaohui Wang
9fa903d728 Merge "Fix app launch button not shown" 2022-09-29 01:40:56 +00:00
Chaohui Wang
9bad2fd7ac Add install & clear app button for instant app
These 2 buttons are only for instant apps.

Bug: 236346018
Test: App Settings page with Instant App
Change-Id: Ibdb27ff78172a59267c16bdfe5a256353fc91b26
2022-09-28 20:28:41 +08:00
Chaohui Wang
ff5d430acc Update Settings App for SpaEnvironment
Bug: 249028339
Test: Manual with Settings App
Change-Id: I4b174d250f20e827a383508beb3c9709128863ba
2022-09-28 15:25:43 +08:00
Chaohui Wang
99fd7e49e6 Fix app launch button not shown
This is caused by using getLaunchIntentForPackage() without specific
which user.

Use packageManagerAsUser to fix this issue.

Bug: 236346018
Test: Manual with Settings App
Change-Id: I7d71f9f46b18299245e654c9eef78232cb5e0392
2022-09-28 15:16:11 +08:00
Chaohui Wang
9e7c6d5ed6 Set showInstantApps = true for All App List
Instant Apps are designed only shows in the All App List and the Storage
App List.

Bug: 235727273
Test: Manual with Settings App
Change-Id: I42e49582c06a7e6aad20ad92627a631584597533
2022-09-27 18:00:58 +08:00
Chaohui Wang
e3aa78922c Update import of DisposableBroadcastReceiverAsUser
Bug: 236346018
Test: Build Settings App
Change-Id: Ib3185872945b04c49fab9fceec44b79a77252ef2
2022-09-27 12:00:47 +08:00
Chaohui Wang
76171b9d79 Add All App List for SPA
This is the App List under Apps page with storage usage size.

Bug: 236346018
Test: Manual with Settings App
Change-Id: I8753160fb1abb609dcf2e9539b04ec5d72548d40
2022-09-26 16:27:09 +08:00
Chaohui Wang
7144d95e4d Merge "Add App Buttons to the App Settings page" 2022-09-26 07:58:57 +00:00