KEY_HIDE_ENABLE_2G is soft removed in Android API level 35
because it hides a security feature. This patch
introduces simplified logic that ignores the
carrier config value. The new behavior is behind a feature flag.
This patch also includes some cleanup.
1. It removes an unneeded check for null carrier config
2. It removes test logic that set the value of KEY_HIDE_ENABLE_2G
in places where it had no impact on the test.
Bug: 300248708
Test: atest Enable2gPreferenceControllerTest
Change-Id: I892d115d1ae173d2f3cd69e8f8b97bc5bfa7c67b
The 2G enable's summary should show the sim card name, not the name of service provider.
Bug: 293715485
Test: build pass
Change-Id: Iead9c4e82cd4bf26451e38ded7cbcd276e9fa5f2
When 2g is disallowed by a device admin the 2g toggle in the preference
screen will implement the following behaviors as a result of being
changed to a RestrictedSwitchPreference:
1. become disabled (greyed out)
2. show a summary message explaining that the preference was disabled by
an admin
3 show a pop up when a user tries to click on the preference informing
them that the setting is unusable because it was disabled by an admin.
Additionally, the toggle will show as unchecked (off) when admins
disable 2g.
When 2g is re-enabled by a device admin, the preference screen will go back
to its previous state.
Test: atest Enable2gPreferenceControllerTest
Bug: b/248250240
Change-Id: I7af901f2d9f62ebfe884e01724d8eff845c2968e
The subscriptionInfo.getCarrierName may be a null, so adding the null
checking.
Bug: 236064286
Test: build pass
Change-Id: I8f6f5ac725d6dd552ac2626725e44f52dcbf6c32
- Since the "Mobile-Data Details Settings" (NETWORK_OPERATOR_SETTINGS) will query Carrier-Config around 70 times during launching, use the Carrier-Config cache to reduce 69 times to speed up the launching time.
- It takes about 3ms to query a Carrier-Config each time.
- Create a singleton class to share the Carrier-Config for all
sub-settings.
Bug: 204135235
Test: manual test
atest -c ApnPreferenceControllerTest \
AutoSelectPreferenceControllerTest \
BackupCallingPreferenceControllerTest \
CarrierConfigCacheTest \
CarrierPreferenceControllerTest \
CarrierSettingsVersionPreferenceControllerTest \
DataServiceSetupPreferenceControllerTest \
Enable2gPreferenceControllerTest \
EnabledNetworkModePreferenceControllerTest \
Enhanced4gBasePreferenceControllerTest \
MobileNetworkUtilsTest \
NetworkProviderBackupCallingGroupTest \
NrAdvancedCallingPreferenceControllerTest \
PreferredNetworkModePreferenceControllerTest \
TelephonyTogglePreferenceControllerTest \
WifiPickerTrackerHelperTest
make RunSettingsRoboTests \
ROBOTEST_FILTER=ContactDiscoveryPreferenceControllerTest
make RunSettingsRoboTests \
ROBOTEST_FILTER=VideoCallingPreferenceControllerTest
Change-Id: I26f9ac115a754910b5d59e820703f1a0e701bb7f
Update "Allow 2G" toggle summary wording to be more clear regarding
the purpose of the toggle and why it may be disabled.
Bug: b/193693810
Bug: b/196183458
Test: manual & atest -c Enable2gPreferenceControllerTest
Change-Id: Iffef8f4f44105de30392c30ffd44c1d62cd066b8
The non-indexable does not work due to the NPE.
Fixes: 186594185
Test: robo test and see the search result.
Change-Id: Idc733b3521a774fa8b61a853aa078f50afc331cb
Implements improved handling of invalid subIds in the
"Allow 2G" controller + unit tests.
Bug: 185264531
Test: m & atest -c Enable2gPreferenceControllerTest
Change-Id: I7587f1a2a8150bbc6cc0864c9a13d0d910a26682
Update BITMASK_2G to include 1xRTT when disabling/enabling 2G
via toggle in Enable2gPreferenceController. This is to align
with TelephonyManager's NETWORK_CLASS_BITMASK_2G.
Bug: b/163168917
Test: m & atest -c Enable2gPreferenceControllerTest
Change-Id: Ia0e099b63a9089be8cd8bfd4211db9eb3c506fc3
Adds (1) Enable2gPreferenceController, the controller for the
"Enable 2G" toggle, and (2) Enable2gPreferenceControllerTest,
the corresponding unit tests.
Test: manul & atest -c Enable2gPreferenceControllerTest
Bug: b/163168917
Change-Id: Ib827cfcfd96fdea77b586c92ae0ec5b2bd5818c3