Commit Graph

589 Commits

Author SHA1 Message Date
Chaohui Wang
5d7228235b Fix AppInstallerInfoPreferenceTest flakiness
Add delay after performClick().

Bug: 289155281
Test: unit test
Change-Id: Ie84a375dfcd053b3a1ea75da05b9f3ff4ee2d5ba
2023-08-28 11:37:48 +08:00
Chaohui Wang
8647256269 Use Mockito Kotlin
Which has better support for Kotlin unit test.

Bug: 289155281
Test: unit test
Change-Id: Ic98ba7e66c124e8398ad01d3bca7ee3a771b06c4
2023-08-21 17:01:52 +08:00
Graciela Putri
ab7f57b17c Merge "Add opt-out properties for aspect ratio settings" into udc-qpr-dev am: 83c8f47ddd am: 725efb1a5a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24309274

Change-Id: I5cdb28b8929b0ab8dba829ee6e12d880ca6cc27b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-16 07:04:50 +00:00
Graciela Wissen Putri
08983e8e63 Add opt-out properties for aspect ratio settings
Don't display aspect ratio options if app has opted out. If app has
opted out only for fullscreen, other aspect ratio options should still
be shown.

Bug: 292583399
Test: UserAspectRatioManagerTest
Change-Id: Ia0b223536407f703826d775468c8f8a0b4822e23
2023-08-15 09:14:21 +00:00
Chaohui Wang
b0b710f1b0 Clean up @OptIn(ExperimentalCoroutinesApi::class)
After runTest get stable.

Bug: 285231003
Test: unit test
Change-Id: I200ba979727b900380b107bd82e1d0e43ab1d994
2023-08-09 17:26:10 +08:00
Chaohui Wang
e9cf4bf65c Merge "Convert DataUsageLib to Kotlin" into main 2023-08-08 05:05:01 +00:00
Chaohui Wang
4000b90fad Merge "Remove context from enterprisePrivacyFeatureProvider" into main 2023-08-04 04:31:44 +00:00
Yanting Yang
f5e74b8f49 Merge "Support App details for work profile apps" into main 2023-08-02 20:12:32 +00:00
Chaohui Wang
3cdf5b9be9 Remove context from enterprisePrivacyFeatureProvider
EnterprisePrivacyFeatureProvider is created by using application
context, no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: I346f2b0ccbb0590f26954603ab630132cd8be63f
2023-08-02 19:10:31 +08:00
Chaohui Wang
515c0b8e3a Remove context from userFeatureProvider
UserFeatureProviderImpl is created by using application context,
no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: I80ac7124c3278399e562d4d7d49d1847847b92af
2023-08-02 17:25:41 +08:00
Yanting Yang
6b02225810 Support App details for work profile apps
App info page stopped supporting the App details feature for work
profile apps in Android N but there is no exact reason from the history.
Try supporting it again to fulfill users' requests and check for
exceptions.

Bug: 264932611
Test: manual & robo and unit tests
Change-Id: I1227cff5e25313905952ba54ab0270cdf4f00fd4
2023-08-01 20:49:24 +08:00
Chaohui Wang
d01245e75b Convert DataUsageLib to Kotlin
For better null safe.

Also add unit tests.

Fix: 290698845
Fix: 290684887
Test: unit test
Test: manual - on Mobile Settings page
Change-Id: I9c9edb9b7cbf7d688a885e5c36b61bd6dc526add
2023-07-31 01:22:58 +00:00
Graciela Putri
9cba6cf4b9 Merge "[3/n] Add aspect ratio app info page" into udc-qpr-dev am: 386b02e906 am: e5e57a8d9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23819685

Change-Id: I0a880774214c804f2c22fb7aa876c39349e71b62
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-28 19:32:46 +00:00
Graciela Wissen Putri
57984f02d5 [3/n] Add aspect ratio app info page
Apps > App Info > Advanced > Aspect ratio

Adds link from aspect ratio app list page to app info. Stops activity if
user chooses a different aspect ratio override.

To enable feature:
adb shell device_config put window_manager enable_app_compat_user_aspect_ratio_settings true
adb shell am force-stop com.android.settings

Bug: 287448187
Test: Manual
      All Settings CUJs passed
      atest SettingsRoboTests:UserAspectRatioDetailsTest
      atest SettingsSpaUnitTests:UserAspectRatioAppPreferenceTest
Change-Id: Id47f291459e62267bf15d629c163dde73d96928a
2023-07-28 09:53:11 +00:00
Chris Antol
b95ceb53ba Merge "Storage Apps Lists SPA migration" into main 2023-07-26 19:00:40 +00:00
Chaohui Wang
a7a10f1088 Merge "Remove context from dashboardFeatureProvider" into main 2023-07-25 23:39:27 +00:00
Chris Antol
993e1cec1f Storage Apps Lists SPA migration
Pending task to support Sorting by Name which is currently not possible given existing SPA infra

Bug: 284032857
Bug: 284032898
Test: Unit Test. Uncomment lines and tested Settings>Storage>Apps and Settings>Storage>Games
Change-Id: I93853ed7184808a083b66ba5b03f9fe3acf48d41
2023-07-21 23:52:27 +00:00
Graciela Putri
8dffd59e3d Merge "[2/n] Add aspect ratio app list page under apps" into udc-qpr-dev am: 4e86d0d6b3 am: dc86dbe24b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23819684

Change-Id: If7c6f4fa26ea014e40e737f07daae8b72481e2c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-21 22:58:58 +00:00
Graciela Putri
4e86d0d6b3 Merge "[2/n] Add aspect ratio app list page under apps" into udc-qpr-dev 2023-07-21 21:28:44 +00:00
Graciela Wissen Putri
b4c4f6cbe6 [2/n] Add aspect ratio app list page under apps
Apps > General > Screen Size

To enable feature:
adb shell device_config put window_manager enable_app_compat_user_aspect_ratio_settings true
adb shell am force-stop com.android.settings

Fix: 287448088
Test: Manual
      atest AspectRatioAppsPageProviderTest
      atest AspectRatioUtilsTest
      All CUJs passed in go/settings-cujs
Change-Id: I4de6c3cbdbdfbc79ed839ec149fb633344dcd3a7
2023-07-21 08:02:09 +00:00
Sunny Shao
4d00821093 Fix the Protocol buffer best practice warnings problem
- Add prefix for the items of the SessionType enums.

Fixes: 287363023
Test: atest SpaActivityTest SpaLogDataTest MetricsDataModelTest
Change-Id: Ifde0b61a05b1257edaca54325a72dad333e43e3c
2023-07-20 21:48:22 +08:00
Chaohui Wang
58f0ee30fc Remove context from dashboardFeatureProvider
DashboardFeatureProviderImpl is created by using application context,
no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: Ia9672dfd9d3d71f64735cbc5979a6ad57c9429d3
2023-07-20 12:21:16 +08:00
Vania Januar
986fe4ebc1 USB firmware update for stylus in Stylus USI Device Details
Bug: 288850921
Test: StylusUsbFirmwareControllerTest, UsbStylusBroadcastReceiverTest
Change-Id: Ic7cb35799ff00f9998ca569eb4ae091f8010780a
Merged-In: Ic7cb35799ff00f9998ca569eb4ae091f8010780a
2023-07-18 14:09:05 +00:00
Vania Januar
a7d9944090 Merge "USB firmware update for stylus in Stylus USI Device Details" into main 2023-07-18 09:16:13 +00:00
Vania Januar
f04363547a USB firmware update for stylus in Stylus USI Device Details
Bug: 288850921
Test: StylusUsbFirmwareControllerTest, UsbStylusBroadcastReceiverTest
Change-Id: Ic7cb35799ff00f9998ca569eb4ae091f8010780a
2023-07-17 13:49:30 +00:00
Chaohui Wang
36b8227073 Remove context from powerUsageFeatureProvider
PowerUsageFeatureProviderImpl is created by using application context,
no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: Iec81e98648fcb2f6a20978ef4ce164e1af50a804
2023-07-13 09:58:54 +08:00
Chaohui Wang
14ab64637e Merge "Remove context from batteryStatusFeatureProvider" into main 2023-07-12 05:03:48 +00:00
Chaohui Wang
b515ed5fee Merge "[Regulatory Labels] Load labels from overlays" into udc-d1-dev am: fe38ff963a am: 47803f6b10 am: fc275fef2e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23939155

Change-Id: I2d9d02579aec65fdc5916522563fad4daada58c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 09:54:45 +00:00
Chaohui Wang
fc275fef2e Merge "[Regulatory Labels] Load labels from overlays" into udc-d1-dev am: fe38ff963a am: 47803f6b10
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23939155

Change-Id: I624e8cf060dae2dfb7a1b0b06c4610adeeddde79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 09:12:13 +00:00
Chaohui Wang
1806b3032f Merge "[Regulatory Labels] Load labels from overlays" into udc-d1-dev am: fe38ff963a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23939155

Change-Id: I46c9e35554f3a7021bb52c79cc73e09971ca4232
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 08:34:42 +00:00
Chaohui Wang
fe38ff963a Merge "[Regulatory Labels] Load labels from overlays" into udc-d1-dev 2023-07-11 07:50:49 +00:00
Chaohui Wang
dc3fc1dff0 Fix crash when call getMobileTemplate am: 9132535e5e am: f3d6684e14
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24002328

Change-Id: Ifbeab53d402207c0cd63ab225f30af6bdc4da824
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-10 08:56:59 +00:00
Chaohui Wang
1578772d63 Fix crash when call getMobileTemplate am: 9132535e5e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24002328

Change-Id: I01c40793839a7d5fbd0b7834c67184c228356c0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-10 08:16:04 +00:00
Chaohui Wang
9132535e5e Fix crash when call getMobileTemplate
There are 2 versions of getMobileTemplate.

The previous Change I7865823d6af2c812afa35d047bd79b60ae4b0fb7 change
from the correct version to the wrong version.

Change back to fix the issue.

Fix: 290381395
Test: manual - on Mobile Settings page
Test: unit test
Change-Id: Icb3147558176d53dc77e7bd39ab54a5dad13c12b
Merged-In: I6227f973ec38e5b0520f54a41ac2ede2929a1bcc
2023-07-10 14:20:07 +08:00
Chaohui Wang
590b4e7af8 [Regulatory Labels] Load labels from overlays
When config_regulatory_info_overlay_package_name is configured, load
regulatory labels directly from overlay package.

Also fix RegulatoryInfoDisplayActivity missing dialog theme.

Bug: 283170651
Test: unit test
Test: manual - check regulatory labels
Change-Id: Ia1f6848abe0da9facf34f47abab09e88d57e74d6
2023-07-07 14:52:26 +00:00
Chaohui Wang
9ed6eccb75 Remove context from batteryStatusFeatureProvider
BatteryStatusFeatureProvider is created by using application context,
no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: Ie5f39c3f074a1937526461eba45f11f7ec212cba
2023-07-06 15:56:08 +08:00
Treehugger Robot
e761690e08 Merge "Clean up assist gesture from Settings" into main 2023-07-06 05:42:20 +00:00
Chaohui Wang
8c37af5ed1 Merge "Use DataUsageLib in DataUsagePreferenceController" 2023-07-05 15:24:45 +00:00
Chaohui Wang
225af2b43f Merge "Remove context from getSupportFeatureProvider" 2023-07-05 03:37:55 +00:00
Chaohui Wang
77fd6aa117 Use DataUsageLib in DataUsagePreferenceController
DataUsagePreferenceController use DataUsageLib before, and DataUsageLib
and com.android.settingslib.net.DataUsageUtils has same functionality.

com.android.settingslib.net.DataUsageUtils will be clean up, so use
DataUsageLib again.

Bug: 286082055
Test: m Settings
Change-Id: I6227f973ec38e5b0520f54a41ac2ede2929a1bcc
2023-07-04 19:08:46 +08:00
Chaohui Wang
47ff48b831 Fix DataUsagePreferenceController ANR am: d42cc8e5e2 am: eb8948e309 am: e76ff6ffa5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23896225

Change-Id: I2b24b59f1d0bcd2b02359128d474f36a74eb367e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-04 10:28:19 +00:00
Chaohui Wang
e76ff6ffa5 Fix DataUsagePreferenceController ANR am: d42cc8e5e2 am: eb8948e309
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23896225

Change-Id: I3e6b70cb33a51348b9504226787de2e149af5870
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-04 09:41:58 +00:00
Chaohui Wang
a51e013746 Fix DataUsagePreferenceController ANR am: d42cc8e5e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23896225

Change-Id: Ia0463b25a848a1b65f10bfb3950b7875bc3498b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-04 09:03:56 +00:00
Chaohui Wang
da796d80f1 Remove context from getSupportFeatureProvider
Bug: 286764889
Test: m Settings
Change-Id: I5635c7a809fd24d59da377993c7d1435d0c839e3
2023-07-04 13:22:48 +08:00
Chaohui Wang
d42cc8e5e2 Fix DataUsagePreferenceController ANR
Offload calculation work from main thread to fix.

Fix: 286082055
Test: manual - on Mobile Settings page
Test: unit test
Change-Id: I7865823d6af2c812afa35d047bd79b60ae4b0fb7
2023-07-04 12:06:53 +08:00
Chaohui Wang
778c2dc3d5 Remove context from applicationFeatureProvider
ApplicationFeatureProvider is created by using application context,
no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: I7f8dfe5716b7b55e0ff984f7603875d7896e2313
2023-07-03 13:54:26 +08:00
Chaohui Wang
99457e53a8 Clean up assist gesture from Settings
This one is replaced by "Press & hold power button".

Bug: 287566056
Test: m Settings
Change-Id: Ic9fe8ab29a0b72f1a47f05b18da99ccf68a7f766
2023-06-29 18:17:10 +08:00
Chaohui Wang
63eddc12dd Refactor FeatureFactory
Not use reflection, sets the FeatureFactoryImpl in SettingsApplication
instead.

Bug: 286764889
Test: m Settings
Test: m SettingsSpaUnitTests
Test: m RunSettingsRoboTests
Change-Id: I881bf1009a94222fc89578d14a6792a6e1507be2
2023-06-28 09:09:39 +00:00
Chaohui Wang
457993bc91 Merge "Clean up AwareFeatureProvider from Settings" 2023-06-27 06:52:13 +00:00
Chaohui Wang
2e4141e4ab Clean up AwareFeatureProvider from Settings
Bug: 287566056
Test: m Settings
Change-Id: I7f7f57809c55bf8824b427f0d4a232cacdbe88a7
2023-06-25 16:52:34 +08:00