Commit Graph

450 Commits

Author SHA1 Message Date
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
Chaohui Wang
9071feb4e6 Merge "Add debug flag for App Settings page" 2022-09-26 07:58:20 +00:00
Chaohui Wang
7fc0b3a70b Add App Buttons to the App Settings page
Including the following,
- Launch
- Disable
- Uninstall
- Force stop

Bug: 236346018
Test: Manual with Settings App
Change-Id: Iecfc2b97cdda4ff0ba5080b4287cc4542ffc57ad
2022-09-26 14:04:56 +08:00
Zekan Qian
f1fabd488f Add EntryProvider in SettingsGoogle
Bug: 244122804
Test: manual - build SettingsGoogle
Change-Id: I8232361633698f4186c0fda12fb44f221426db9c
2022-09-23 10:44:41 +08:00
Zekan Qian
90e5e91f28 Explicitly set parameter name when call SettingsPage.create function
Bug: 244122804
Test: manual - build SettingsGoogle
Change-Id: I068857ac3a5e12cfcf0148789b546476663414e1
2022-09-22 11:08:02 +08:00
Chaohui Wang
11a5c2adaf Add debug flag for App Settings page
Default no-op, if SETTINGS_ENABLE_SPA is enabled, InstalledAppDetailsTop
will navigate to SPA AppSettings instead of AppInfoDashboardFragment.

Bug: 236346018
Test: Manual with Settings App
Change-Id: I0b8a668df1f8783b860baae1d912157f742baf3f
2022-09-20 20:19:22 +08:00
Chaohui Wang
d4f1898e95 Add new Alarms & reminders App List
The entry item will also be available through App Settings.

Bug: 235727273
Test: Manual with Settings App
Change-Id: I2e40803203e5430988b6e7394856448c82e20fd2
2022-09-20 12:39:20 +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
Chaohui Wang
db20bf69f6 Set switchRestrictionKeys for InstallUnknownApps
To support the "Disabled by admin" feature.

Bug: 235727273
Test: Manual with Settings App
Change-Id: Ic76e17fd03ef13ba0249d202d132f72824fa60d3
2022-09-16 15:03:56 +08:00
Chaohui Wang
aea2e7cd2e Merge "Migrate UsageStats to Spa" 2022-09-14 08:38:28 +00:00
Zekan Qian
d488206364 Merge "Add debug page in Settings" 2022-09-14 01:55:02 +00:00
Zekan Qian
eaa0ca22e7 Add debug page in Settings
Bug: 244122804
Test: manually build SettingsGoogle
Change-Id: I4853e17028dfe0eed4342b4691962b508bc87357
2022-09-13 10:19:37 +00:00
Chaohui Wang
186eb66c4f Add 4 app op permission App List
- All files access
- Display over other apps
- Media management apps
- Modify system settings

Bug: 235727273
Test: Manual with Settings App
Change-Id: I60abb44558f535d5e26d498164d5429ede4033f8
2022-09-13 17:24:48 +08:00
Chaohui Wang
d22619e995 Migrate UsageStats to Spa
The UsageStats page is for testing only, cannot entry through Settings
Home, but is accessible by enter *#*#4636#*#* in dialer.

Migrate UsageStats to Spa for both improving the UI & performance.

Fix: 244675756
Bug: 235727273
Test: Manual with Settings App
Change-Id: I6ec6e233075a3f79ac1231aecafabf2a71dac716
2022-09-09 16:00:41 +08:00
Zekan Qian
6243eb3ec9 Add param name when use SettingsEntry.createInject api.
Use SettingsPage.create api to create SettingsPage.
Remove debug button in HOME page.

Bug: 244122804
Test: manual - build SettingsGoogle
Change-Id: I59b6f4c0ead0b3f0dc06eb238b074d2cf91cf74c
2022-09-09 14:23:35 +08: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
Zekan Qian
3e34da5d7e Followup SppRepo refactor in Settings
Bug: 244122804
Test: manual - build SettingsGoogle
Change-Id: Ib0d75d7a34a6f8d922749916b793dcb81b9fd0fd
2022-09-06 15:31:36 +08:00
Chaohui Wang
7d91106e69 Add AppListNotifications to Spa
Bug: 235727273
Test: Manual with Settings App
Change-Id: I9d8f9ec74a3661d3d3784cbc7afe02a708035c7e
2022-09-06 12:41:42 +08: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
Chaohui Wang
805f903ae4 Add SpaLib for Settings
SPA main activity can be launched by:
adb shell am start com.android.settings/.spa.SpaActivity

Bug: 235727273
Test: Manual launch SPA main activity
Change-Id: I7b196b0169f91732a6b37ff53a3f79b54267d93f
2022-08-30 16:39:03 +08:00