Commit Graph

66 Commits

Author SHA1 Message Date
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
Weng Su
d078d1f00a Merge "Refer to the last Hotspot password when generating the password" into udc-dev 2023-02-25 02:33:55 +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
Weng Su
d7bbd4505c Refer to the last Hotspot password when generating the password
- Query the last Hotspot password when security type is SECURITY_TYPE_OPEN and it will be used when the user changes to another security type

- If the last hotspot password is an empty string, then generate random password

Bug: 201789473
Test: manual test
atest -c WifiHotspotRepositoryTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPasswordPreferenceControllerTest

Change-Id: Id3a846099238433e7b6c8b934fa26a74df0dcb61
2023-02-24 11:22:40 +08:00
Chaohui Wang
d67bd3b575 Fix calculateSizeBytes
dataBytes including cacheBytes, so not adding cacheBytes separately.

Bug: 236346018
Test: Manually with Settings
Change-Id: I92ecad3d9ec7a29d690e8ceba2614dd11b561ad3
2023-02-08 16:17:28 +08: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
Chaohui Wang
1732c22706 Add unit test for Picture In Picture
Bug: 260660819
Test: Unit test
Change-Id: I64917bf58082b49ffcfbb4926e8ccd26d2e7c5f4
2023-01-19 17:37:13 +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
Chaohui Wang
4525cfb462 Merge "Remove EXTRA_USER_HANDLE from startSpaActivityForApp" 2023-01-05 11:06:08 +00:00
Chaohui Wang
875cbba0af Merge "Add spinner options to "All apps"" 2023-01-05 11:05:23 +00:00
Chaohui Wang
c14729295e Merge "Move common startUninstallActivity to AppUtil" 2023-01-05 03:50:28 +00:00
Chaohui Wang
74b3bfc066 Add spinner options to "All apps"
Spinner options only shows when there is any disabled or instant apps.

Fix: 264228237
Test: Manually with Settings
Test: Unit test
Change-Id: I9f916c1076b2d754b8c5f30244eac5d5c0bc78f4
2023-01-04 17:06:12 +08:00
Chaohui Wang
4710cfc7ed Move common startUninstallActivity to AppUtil
And also suppress the warnings.

Bug: 236346018
Test: Unit test
Change-Id: I469e563fdeea0bec0587a255b15fddcaaab7f2c3
2023-01-04 16:58:39 +08:00
Chaohui Wang
afeb7496bb Remove EXTRA_USER_HANDLE from startSpaActivityForApp
Bug: 263553430
Test: Unit test
Change-Id: I6739d4518eac00cfe22905c1a6589b6e9f91a1d3
2023-01-04 16:26:04 +08:00
Yilin Cai
fa93f941ef Fork the Wi-Fi control setting page to SPA.
The page is located at "Apps > Special app access > Wi-Fi control".

Test: atest SettingsSpaUnitTests:com.android.settings.spa.app.specialaccess.WifiControlAppListModelTest
Test: local device (http://screen/3a4mkuAwPJoY6rf, http://screen/4fzttXjBqcEKcXA)
Bug: 262206181
Change-Id: Ibef029e6d83849a0eb0d779e5ed6dedfc2fe4b43
2023-01-04 10:56:44 +08:00
Chaohui Wang
36903136af Fix AppDataUsagePreferenceTest#whenHasDataUsage
Fix: 264141691
Test: Unit test
Change-Id: I208f6f8f04d0ed59e31b795f5c90a64e0f76cfa3
2023-01-03 11:47:25 +08:00
Chaohui Wang
a9c624b0d3 Add SpaAppBridgeActivity for application usage
This requires the user to pass into the package name, which enabling
the feature of navigating to app info pages.

Bug: 263553430
Test: Manually with Settings
Change-Id: I9405e3732d99f78cd87e62d73b0c9519a8e2d71f
2022-12-26 20:22:38 +08:00
Chaohui Wang
366649ed1c Merge "Set setModeByUid to align with current behavior" 2022-12-22 14:14:17 +00:00
Chaohui Wang
35e0ff2fb7 Merge "Add AppNotificationPreference to App Info Settings" 2022-12-21 04:51:04 +00:00
Chaohui Wang
dcd965b816 Add AppNotificationPreference to App Info Settings
This is only for the App Info Settings page, which is planed to be
migrated to SPA in Android U.

Currently protected by flag settings_enable_spa, default false.

This will not impacted the AppNotificationSettings, which has no plan
to be migrated.

Bug: 236346018
Test: Unit test
Test: Manual with Settings App
Change-Id: I4ae669ce36eb6ab73f1adf99585f424e03bf90fb
2022-12-21 04:50:12 +00:00
George Chan
d18b422c51 Added Background install control UI code.
Change-Id: I1b629fdc04d1df1b08998c9aaae3df3446fab3fe
Bug: 238451991
Test: Manually with settings, atest
2022-12-20 22:38:01 +00:00
Chaohui Wang
d735f9a1a8 Set setModeByUid to align with current behavior
For the following App Lists,
- All Files Access
- Media Management Apps

Default false, if true, use AppOpsManager#setUidMode instead of #setMode

This follows Change: I261953ff88bc049cf0a2f04f8caac00b8cc6f704
Reason:
Security related app-ops should be set with AppOpsManager#setUidMode
instead of AppOpsManager#setMode.

Bug: 235727273
Test: Unit test
Change-Id: I953b63c2bf6f3bd94aacc935c8c3579bc8aed199
2022-12-19 16:09:19 +08:00
Chaohui Wang
b760ffdc1a Refactor AppNotificationRepository
Also add unit tests.

Bug: 236346018
Test: Manual with Settings App
Change-Id: Idf3fbcb3dff2cbee9039ff67b5c0f09133f9ff86
2022-12-18 19:47:32 +08:00
Chaohui Wang
1445d985bb Move AppItem into AppListModel
Follows the api changes in Spa privileged lib.

Bug: 260660819
Test: Unit test
Test: Manually with Settings
Change-Id: Ieec1035070cc532eedcd1511c5b347e04099a9fb
2022-12-15 12:32:54 +08:00
Chaohui Wang
b4a8e4b314 Reduce flaky of whenCanDisplayLocalUi_displayed
Bug: 246877208
Test: Unit test
Change-Id: I0b2554521b55fcfacc24e59a81ddc08b2eb9d70c
2022-12-07 12:03:47 +08:00
Chaohui Wang
681b519b80 Migrate AppPermissionSummaryTest to AndroidJUnit4
Bug: 260441791
Test: Unit test
Change-Id: I72a63f9247ae370dbfcb0ff2babbfdfc95bd60a2
2022-12-06 13:28:39 +08:00
Chaohui Wang
07fc7f1044 Add unit test for AllAppList
Bug: 260660819
Test: Unit test
Change-Id: I15e294d8b90d385e932adc3bf0d61e6923941542
2022-12-05 21:07:44 +08:00
Chaohui Wang
fb8200aef8 Merge "Add ResetAppPreferences to AllAppListPage" 2022-11-30 06:55:46 +00:00
Chaohui Wang
1b9e346fa9 Merge "Reduce flaky of AppStoragePreferenceTest" 2022-11-29 04:10:00 +00:00
Chaohui Wang
a43b2b5df4 Reduce flaky of AppStoragePreferenceTest
Summary is async so wait for it.

Bug: 236346018
Test: Unit test
Change-Id: I80a3409008c2c42eda10e9e9711d9da15d533ba9
2022-11-28 21:12:18 +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
e62377a1e7 Reduce flaky of App Info tests
Bug: 236346018
Test: Unit test
Change-Id: If810ef57675b8fb3bab533360bb62cc41a8cc9d8
2022-11-26 21:04:45 +08:00
Chaohui Wang
92d766300d Reduce flaky of SettingsSpaUnitTests
Bug: 236346018
Test: Unit test
Change-Id: I8069a9dcb80f0379f1113c3dbfa5784efcdc8601
2022-11-22 17:29:29 +08:00
Chaohui Wang
3d10bebe06 Move ComposeContentTestRuleExt to SpaLibTestUtils
Also fix some failed tests.

Bug: 259520506
Test: Unit test
Change-Id: I0eaf00defdad2b90bf4e67476e33a86751488bc0
2022-11-22 00:30:52 +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
a6b0fe32fa Remove kotlin.RequiresOptIn
Which is now enabled by default.

Bug: 253772249
Test: Presubmit
Change-Id: Ida4e35235c0bc0be973634988b037dec0ad829bc
2022-11-17 00:01:37 +08:00
TreeHugger Robot
148774d287 Merge "Fingerprint Introduction FragmentActivity" 2022-11-16 00:04:49 +00:00
Milton Wu
b9b8b8a512 Fingerprint Introduction FragmentActivity
Introducing MVVM architecture & fragments to biometric settings.
Here, we modify the first page of FingerprintEnrollIntroduction to use
new MVVM with Fragment architecture.

And with this new architecture, unit test and screen order will be
easier to be written or changed.

Bug: 236072782
Test: atest FingerprintEnrollmentViewModelTest AutoCredentialViewModelTest
	    FingerprintEnrollIntroViewModelTest FingerprintRepositoryTest
Change-Id: Icf12c91625db86c2c99081a0108203e607e77f74
2022-11-14 15:36:03 +08: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
Kweku Adams
d7194ad75d Set package name.
The system expects an actual package name in the ApplicationInfo object
so make sure to set it in the test object.

Bug: 258472566
Test: atest AppButtonsTest
Change-Id: I3bee07a6a395c9962af57f934cf3ca86eb60354a
2022-11-09 20:57:23 +00: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
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
Chaohui Wang
85cb46094c Merge "Add AppSettingsPreference for Spa" 2022-10-28 12:53:12 +00:00