Commit Graph

589 Commits

Author SHA1 Message Date
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
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
ca7eca1440 Merge "Add AppInstallerInfoPreference for Spa" 2022-10-28 03:08:06 +00: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
70e1f6abac Correct the name of AppLocalePreferenceTest
Bug: 236346018
Test: Unit test
Change-Id: I986b4f7daf2983d25eae55879808b3ae74f5b94c
2022-10-27 16:44:08 +08: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
b752c3d058 Make the default getTimeSpentInApp() return empty
Current ApplicationFeatureProvider.getTimeSpentInApp() defaults returns
null, in extreme case there is ACTION_APP_USAGE_SETTINGS handler on
device but getTimeSpentInApp() still returns null, may lead
AppTimeSpentPreference to crash.

Make it returns empty string instead to eliminate this extreme case.

Bug: 236346018
Test: Unit test & Manual with SpaActivity
Change-Id: I33b413ceb9bdf48e3902e02c91fab617fe297862
2022-10-19 15:57:50 +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