Commit Graph

589 Commits

Author SHA1 Message Date
Chaohui Wang
7e8e683e60 Migrate to AppStorageRepository
Bug: 321861088
Flag: EXEMPT bug fix
Test: manual - on All apps and App info
Test: atest AppStorageSizesControllerTest
Test: atest AppStoragePreferenceTest
Change-Id: I3143de720493cb09854621b115d07e76bebf6699
2025-01-09 16:56:42 +08:00
Chaohui Wang
3380884efc Merge changes from topic "BytesFormatter" into main
* changes:
  Migrate all data usage format use case
  Clean up unused DataUsageSummary.formatUsage
  Use BytesFormatter for data usage
2025-01-06 19:06:34 -08:00
Hani Kazmi
57e649ae4e Merge "Revert "Revert "[AAPM] Add advanced protection dialog according ..."" into main 2025-01-03 09:25:46 -08:00
Chaohui Wang
d3448f3a91 Migrate all data usage format use case
Now they are all aligned.

Bug: 321861088
Flag: EXEMPT bug fix
Test: unit test
Change-Id: I1981fd32fd24de7c9eff93e0cd638e862f01b9b9
2025-01-02 18:14:10 -08:00
Chaohui Wang
611c62294a Use BytesFormatter for data usage
Change "480 B" to "480 byte".

And no longer use FormattedDataUsage.

Bug: 321861088
Flag: EXEMPT bug fix
Test: manual - App data usage
Test: unit test
Change-Id: I9ed220e2d5b8fc512d7d28f6fa7faebb37beab83
2025-01-02 18:14:10 -08:00
Adam Bookatz
2a828c6bde Merge "Expand uninstallForAll to Admins" into main 2025-01-02 11:01:50 -08:00
Hani Kazmi
8e28132ba2 Revert "Revert "[AAPM] Add advanced protection dialog according ..."
Revert submission 31078830-revert-30767017-aapm-dialog-api-feedback-TBLFTCNTUN

Reason for revert: Addressed failing test

Reverted changes: /q/submissionid:31078830-revert-30767017-aapm-dialog-api-feedback-TBLFTCNTUN

Change-Id: I3321b4f5baaca9dd270350b9201998ffe0d40473
2025-01-02 05:07:50 -08:00
Chaohui Wang
440c3c2779 Reduce Mobile data switch flaky
Set initial value to null, so no animation when the actual value true
is emitted.

Bug: 329584989
Flag: EXEMPT bug fix
Test: manual - on SIMs
Test: unit test
Change-Id: I3eea55115f02e65dcdcc44ccf917f9083622b723
2024-12-31 14:54:54 +08:00
Priyanka Advani (xWF)
47d59ab974 Merge "Revert "[AAPM] Add advanced protection dialog according to API f..."" into main 2024-12-27 14:25:58 -08:00
Chaohui Wang
8c0b1ef270 Merge "Send initial status for wifiStateFlow" into main 2024-12-23 19:02:54 -08:00
Priyanka Advani (xWF)
2574343b43 Revert "[AAPM] Add advanced protection dialog according to API f..."
Revert submission 30767017-aapm-dialog-api-feedback

Reason for revert: Droidmonitor created revert due to b/384828570. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:30767017-aapm-dialog-api-feedback

Change-Id: Ibf26aca2453f2007370974290f5c16d6b091341e
2024-12-23 13:41:43 -08:00
zhibinliu
b2ee5ccf5b Check package name format before using it for SPA nav
Bug: b/372895305
Test: unit test
Flag: EXEMPT bug fix
Change-Id: Ife615c78c48a2d6f5b938c880c9c2128c5551644
2024-12-23 06:41:40 -08:00
Chaohui Wang
d830acf625 Send initial status for wifiStateFlow
To make sure this flow is never empty, use unknown as default.

Fix: 383050153
Flag: EXEMPT bug fix
Test: manual - on Network & internet
Test: unit test
Change-Id: Iaa421749ab917ebc651a95ccdf1a4ab1cb9ba112
2024-12-23 11:50:51 +08:00
Treehugger Robot
75cae48694 Merge "[HSUM] Fix BatteryOptimizationModeAppListPageProviderTest" into main 2024-12-19 21:06:29 -08:00
mxyyiyi
56c4bd723a [HSUM] Fix BatteryOptimizationModeAppListPageProviderTest
Headless System User Mode will use startActivityAsUser() instead of startActivity().

Bug: 383541859
Flag: EXEMPT bug fix
Test: atest BatteryOptimizationModeAppListPageProviderTest
Change-Id: Ic4a0fca1a5835c0dab292b8665551cb2ca9f6640
2024-12-20 11:52:04 +08:00
Azhara Assanova
f2f9874122 Merge "[AAPM] Add advanced protection dialog according to API feedback" into main 2024-12-19 09:41:27 -08:00
Adam Bookatz
49d3e34810 Expand uninstallForAll to Admins
Currently, user 0 can uninstall other users' apps. It really has that
ability by virtue of it being an Admin user. But non-user-0 Admins don't
currently have this ability, so we expand that here. This also allows
this ability on HSUM, where human Admin users aren't user 0.

Bug: 384514936
Test: manual confirmation that overflow appears on HSUM device
Test: atest SettingsSpaUnitTests:com.android.settings.spa.app.appinfo.AppInfoSettingsMoreOptionsTest
Flag: EXEMPT bugfix
Change-Id: I976bb63ecced3c128f8109c63c85067f4a0cdf9b
2024-12-17 13:47:19 -08:00
Azhara Assanova
e2248f1c4f [AAPM] Add advanced protection dialog according to API feedback
This change also updates ActionDisabledByAdminDialog because the
AdvancedProtectionManager#createSupportIntent method is now static.

Bug: 378968840
Bug: 352420507
Test: ActionDisabledByAdminDialogTest
Test: WepNetworksPreferenceControllerTest
Test: manual
Flag: android.security.aapm_api
Change-Id: I8443742aadead45091fee757cbdf715d28eee495
2024-12-13 13:25:38 +00:00
Weng Su
e5d19b38cb Skip authentication if device was unlocked recently
- Sync the same behavior from SystemUI to Settings

Bug: 365611488
Flag: EXEMPT bugfix
Test: Manual testing
atest -c WifiNetworkDetailsFragmentTest \
         WifiDetailPreferenceController2Test \
         WifiTetherSSIDPreferenceControllerTest \
         com.android.settings.wifi.dpp.WifiDppUtilsTest
atest -c com.android.settings.spa.wifi.dpp.WifiDppUtilsTest

Change-Id: Ie3e8374b1fdbbc61e9e5bbf0f5162b18ba1452f3
2024-12-13 18:10:44 +08:00
Hani Kazmi
2ccbf1dbe9 Merge "[AAPM] UX for disabling WEP" into main 2024-12-11 09:05:58 -08:00
tomhsu
480053e03f fix failed of PrimarySimRepositoryTest#getPrimarySimInfo_verifySmsList
- config_sms_ask_every_time_support was changed from true to false, so cause this test failed.

Flag: EXEMPT bug fix
Fix: b/382189034
Test: atest pass
Change-Id: Ia7ae0812f2b417bd8350d09417547dfc474397a0
2024-12-05 07:51:55 +00:00
Hani Kazmi
4efa8adfa6 [AAPM] UX for disabling WEP
Toggle is restricted, and trying to connect shows an error

Bug: 352420507
Change-Id: If20bf030d1c0aba55dac135a9f5f51e9a4255596
Test: Manually. Automated tests to follow
Flag: com.android.wifi.flags.wep_disabled_in_apm
2024-12-04 16:01:07 +00:00
tomhsu
9329684c86 Fix crash due to no Satellite
- AutoSelectPreferenceController get null pointer exception

Flag: EXEMPT bug fix
Fix: b/381995900
Test: atest pass
Change-Id: Iadbd83825cdfbc0aabd85b79e9ad7043f172a8a1
2024-12-03 09:02:31 +00:00
Treehugger Robot
6b98c4e74b Merge "[SPA] Add biometric authentication for package modification" into main 2024-12-02 15:39:51 +00:00
Shraddha Basantwani
32e388ad31 [SPA] Add biometric authentication for package modification
Add an extra step of Lock Screen for disabling, force-stopping or
uninstalling updates for protected packages

UI Change Details : https://drive.google.com/drive/folders/1w7gKTmCxQ_j-9GQnIpEfF5_gmQ27b8l_?resourcekey=0-brLdN8VfqVPGm2FMwfrmkQ&usp=drive_link
Bug: 352504490, 344865740
Test: atest AppButtonsPreferenceControllerTest PackageInfoPresenterTest
Flag: EXEMPT High Security Bug
Change-Id: I0c494e307b02229d751de118abcc89e4e61a6861
2024-12-02 09:36:05 +00:00
Chaohui Wang
e731f7cce2 Fix TetherPreferenceController ANR
getAvailabilityStatus() is called in main thread, so we should avoid
time consuming works in it.

Fix: 377146536
Flag: EXEMPT bug fix
Test: manual - on Network & internet
Test: unit test
Change-Id: Ib5ee19744cf164f91aa90be982f5fc5eead5d4d3
2024-12-02 11:56:54 +08:00
tomhsu
9ca8709173 Disabled Settings preference in case Satellite's conditions.
Conditions
   - Satellite session started
   - Current subscription for Satellite is carrier based.
 Target preference UI in android settings
   - preferred network type
   - Automatically select network

Flag: com.android.settings.flags.satellite_oem_settings_ux_migration
Fix: b/378409439
Fix: b/378409428
Test: atest pass
Test: Manual test pass
Change-Id: I7aa04b818c8866bf5c891c28372a249c964b066f
2024-11-28 10:37:35 +00:00
Chaohui Wang
4e4ee7430c Unify and merge two hasAllApns()
Also add unit tests.

Fix: 374226933
Flag: EXEMPT refactor
Test: manual - on ApnSettings
Test: atest ApnTypesTest
Change-Id: Ie82252ed13d81118292214b360ac49de9a81b7cc
2024-11-12 17:08:16 +08:00
Chaohui Wang
37915bcab2 Merge "Remove TelephonyManagerConstants" into main 2024-11-01 07:17:37 +00:00
SongFerng Wang
10373c67c0 Merge "Modify the condition for showing DSDS dialog" into main 2024-10-28 02:59:18 +00:00
songferngwang
be68a15621 Modify the condition for showing DSDS dialog
Previous condition: there is the psim when the user enable esim
New condition: there is an active psim when the user enable esim

Bug: 362368874
Test: Test UI, atest SimOnboardingServiceTest
Flag: EXEMPT bugfix
Change-Id: I4260674794a961080b1f49e0f3d07ca9f2cf6ab6
2024-10-24 19:00:00 +00:00
songferngwang
8f6145c143 Add the condition to hide the MMS messages preference
If the carrier config KEY_MMS_MMS_ENABLED_BOOL is false, then the
settings hide the MMS messages preference

Test: atest MmsMessagePreferenceControllerTest
Bug: 371965435
Flag: EXEMPT bugfix
Change-Id: I93479bba28120f7b6cc5449f4a8277945d308e40
2024-10-22 10:28:13 +00:00
Chaohui Wang
bf5c04e16b Remove TelephonyManagerConstants
- Must migrated to TelephonyManager directly
- Except NETWORK_MODE_UNKNOWN not in TelephonyManager, moved to
  newly created NetworkModes
- Move addNrToLteNetworkMode() and reduceNrToLteNetworkMode() to
  NetworkModes and adding tests

Bug: 373771849
Flag: EXEMPT refactor
Test: manual - on sims settings
Test: unit tests
Change-Id: I0781a59905415aa7896510ad086d19da48e8ba37
2024-10-18 12:02:53 +08:00
Chaohui Wang
44527db356 Fix PhoneNumberPreferenceControllerTest
Fix: 373247298
Flag: EXEMPT test only
Test: atest PhoneNumberPreferenceControllerTest
Change-Id: Ied4c46beca9130ea2db469e3f5dfe708c84b7373
2024-10-14 13:24:37 +08:00
songferngwang
8e6bc6f289 VideoCalling UI adds the init value
Bug: 367696228
Test: atest VideoCallingPreferenceControllerTest
Flag: EXEMPT bugfix
Change-Id: I1a1de9e3174a9211be619c96c104607f831b51a2
2024-10-03 14:29:05 +00:00
Chaohui Wang
9969334647 Fix Can't Able to Click Sims
The root cause is SubscriptionManager.OnSubscriptionsChangedListener
.onSubscriptionsChanged() not invoked in some cases.

Even the SubscriptionManager.addOnSubscriptionsChangedListener's doc
says the onSubscriptionsChanged() method will also be invoked once
initially when calling it, there still case that the
onSubscriptionsChanged() method is not invoked initially.
For example, when the onSubscriptionsChanged event never happens before,
on a device never ever has any subscriptions.

Adding a .onStart { emit(Unit) } to fix.

Also make the subscriptionsChangedFlow() a shared flow to mitigate the
extra emit cost.

Bug: 369276595
Flag: EXEMPT bug fix
Test: manual - factory reset & no any sim
Test: atest SubscriptionRepositoryTest
Change-Id: Ic32a5666f14373926b5dfedb5dedadb4369acfc7
2024-09-26 13:29:47 +08:00
Chaohui Wang
0b530fd405 Use hasScrollAction in ApnEditPageProviderTest
Instead of assuming a fixed tree structure in testing.

Fix: 369416630
Flag: EXEMPT gradle only
Test: atest ApnEditPageProviderTest
Change-Id: I0a50e7665d9049e089b5a0877f17d1f736ee3332
2024-09-25 10:26:47 +08:00
Chaohui Wang
73fb290969 Check DISALLOW_CONFIG_MOBILE_NETWORKS when search
If disallowed, not show mobile related search results.

Bug: 358238959
Flag: EXEMPT bug fix
Test: manual - search Mobile Settings
Test: atest MobileNetworkSettingsSearchIndexTest
Change-Id: I79b984f41f09dd9612bcd0c9942089756d5d365d
2024-09-23 11:17:55 +08:00
Treehugger Robot
4f6b56277c Merge "Fix crash when phone process has problem." into main 2024-09-19 13:04:54 +00:00
tomhsu
56ff329900 Fix crash when phone process has problem.
- Phone process may not exist in some situation. It shall catch the
   exception to avoid Settings crash.

Flag: EXEMPT bugfix
fix: 365669913
Test: build pass
Change-Id: I2b95f46b8887a9c8416fb4a5724537ad27e86850
2024-09-19 11:37:02 +00:00
Chaohui Wang
275fbccd47 Merge "Create MobileNetworkSummaryRepository" into main 2024-09-19 07:51:18 +00:00
SongFerng Wang
501bc72850 Merge "Add the awaitIdle" into main 2024-09-18 09:04:20 +00:00
Chaohui Wang
777a179bd6 Create MobileNetworkSummaryRepository
For MobileNetworkSummaryController to use, so it no longer use
MobileNetworkRepository.

Fix: 366097262
Flag: EXEMPT refactor
Test: manual - on Network & internet
Test: atest MobileNetworkSummaryRepositoryTest
Change-Id: I8a9d52af8e230fc407a4339c27f73ef79d512b24
2024-09-18 13:07:50 +08:00
songferngwang
0fae9c3492 Add the awaitIdle
To fix the "androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 1000 ms"

Bug: 351915085
Test: atest SimOnboardingLabelSimTest
atest SimOnboardingSelectSimTest
Flag: EXEMPT bugfix

Change-Id: I61e192ab9e0518ed40823aa92609d2f9e753bdee
2024-09-18 02:57:21 +00:00
Chaohui Wang
958639b79c Merge "Create SimRepository" into main 2024-09-13 02:40:52 +00:00
Chaohui Wang
a6db1aabb6 Create SimRepository
Which unifies whether we should sim settings on some related pages.

Before this change, we check SubscriptionUtil.isSimHardwareVisible()
and / or Utils.isWifiOnly().

After this change, we unified logic to,
canChangeSimSettings() =
  packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) &&
    userManager.isAdminUser

Fix: 365924140
Flag: EXEMPT bug fix
Test: manual - check Network & internet
Test: unit tests
Change-Id: Ibf83237e3d0088f78c96a1b39ee8f1e3a9c756ea
2024-09-12 08:59:26 +00:00
Chaohui Wang
ced86bf56d Create selectableSubscriptionInfoListFlow
Which can be used in MobileNetworkSummaryController in the future.

Bug: 366097262
Flag: EXEMPT refactor
Test: manual - check Network & internet
Test: unit tests
Change-Id: Ia74af993646c2e1d53817f1e9f8ac3ef0b8fa97a
2024-09-12 11:43:05 +08:00
Chaohui Wang
9b118faa3e Merge "Create NrRepository" into main 2024-09-10 03:36:02 +00:00
Chaohui Wang
9179ad5fc2 Create NrRepository
To unify the isNrAvailable logic.

Bug: 358000881
Flag: EXEMPT refactor
Test: manual - on mobile settings
Test: atest NrRepositoryTest
Change-Id: I60fed4be10f0cc7b8b1a942abd598e82c53d1473
2024-09-05 15:56:43 +08:00
Chaohui Wang
426cbd623d [Safer intents] App Time Spent Preference
Set package com.android.internal.R.string.config_systemWellbeing to the
intent.

Fix: 356117796
Flag: EXEMPT bug fix
Test: manual - on App info
Test: atest AppTimeSpentPreferenceTest
Change-Id: I2af7b53a75fe5c6915dd9781406039822789c18c
2024-09-04 11:18:28 +08:00