Commit Graph

20 Commits

Author SHA1 Message Date
talreja
868299303e Updated the 2G enable setting title.
Bug:391709444
Test: atest Enable2gPreferenceControllerTest
Flag: EXEMPT bugfix

Change-Id: I66bd05441e29b4976343d145ebecaf11fa924b0c
2025-03-12 19:12:48 -07:00
songferngwang
e4c2cddfae Add null checker for telephonymanager
Bug: 399023211
Test: atest Enable2gPreferenceControllerTest
Flag: EXEMPT bugfix
Change-Id: I3872ecfff2296cbec9f0ef54ee7cee5a554f111f
2025-02-25 08:41:55 +00:00
Gil Cukierman
761fd612c4 Stop honoring CarrierConfigManager.KEY_HIDE_ENABLE_2G
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
2023-10-04 13:59:55 +00:00
SongFerng Wang
4f32231cda Merge "The 2G enable's summary shows the sim card name" into udc-qpr-dev am: 9265db6557 am: e527493354
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24342218

Change-Id: Ie234d3200f8adf08ed3022a7c08644f019a7bd60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10 06:30:37 +00:00
SongFerng Wang
06a37cda0b The 2G enable's summary shows the sim card name
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
2023-08-08 09:16:16 +00:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Gil Cukierman
a2ddff3865 Honor DISALLOW_CELLULAR_2G User Restriction in Enable2gPreferenceController
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
2022-10-19 21:01:17 +00:00
SongFerngWang
fd583a0459 Fix the NullPointException am: 5a4df243f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18921546

Change-Id: Icb8aae31d833d27bb64040af296f096471838785
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 07:27:56 +00:00
SongFerngWang
5a4df243f0 Fix the NullPointException
The subscriptionInfo.getCarrierName may be a null, so adding the null
checking.

Bug: 236064286
Test: build pass
Change-Id: I8f6f5ac725d6dd552ac2626725e44f52dcbf6c32
2022-06-16 10:46:07 +08:00
Gil Cukierman
ad8685a28e Merge "Improve documentation of Enable2gPreferenceController" am: 778d851165 am: fecd7c1c1a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2120772

Change-Id: I52b1fba91b6d25b5b02d94d9ae3fd9cf307cb37f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 20:16:03 +00:00
Gil Cukierman
55e8d38038 Improve documentation of Enable2gPreferenceController
Test: javadoc changes only
Fix: 235251754
Change-Id: Ieee483fdbeac3e581085c1a776974f82090743bc
2022-06-09 13:47:45 +00:00
Weng Su
7822750c31 Enable Carrier-Config cache for Settings
- 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
2022-01-14 23:28:50 +08:00
Yomna Nasser
91036f8945 Update "Allow 2G" toggle summary wording.
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
2021-12-23 07:11:36 +00:00
Jack Yu
3616520985 Merge "API Review: Rename CAPABILITY_ALLOWED_NETWORK_TYPES_USED" into sc-dev 2021-05-19 16:26:18 +00:00
SongFerngWang
d7969369de API Review: Rename CAPABILITY_ALLOWED_NETWORK_TYPES_USED
CAPABILITY_ALLOWED_NETWORK_TYPES_USED is renamed CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK
Bug: 182198501
Test: atest packages/apps/Settings/tests/unit/src/com/android/settings/network/telephony/Enable2gPreferenceControllerTest.java
atest frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/RadioConfigResponseTest.java

Change-Id: Id9a27ad972ba7b27311e1b8c6b245f42b94fc7be
2021-05-17 17:20:54 +08:00
Stanley Wang
81524c89cc Fix the "Video call" can be searched on unsupported device.
The non-indexable does not work due to the NPE.

Fixes: 186594185
Test: robo test and see the search result.
Change-Id: Idc733b3521a774fa8b61a853aa078f50afc331cb
2021-05-05 11:32:10 +08:00
Yomna Nasser
e43f26294d Handle invalid subIds in Enable2gPreferenceController.
Implements improved handling of invalid subIds in the
"Allow 2G" controller + unit tests.

Bug: 185264531
Test: m & atest -c Enable2gPreferenceControllerTest
Change-Id: I7587f1a2a8150bbc6cc0864c9a13d0d910a26682
2021-04-22 00:14:29 +00:00
Yomna Nasser
6adc5ab334 Add metrics to Enable2gPreferenceController.
Test: m & atest -c Enable2gPreferenceControllerTest & statsd_testdrive 97
Bug: b/181699391
Change-Id: I1ad860937cec7594c482706cadd853b115436594
2021-03-05 01:18:40 +00:00
Yomna Nasser
7c7977efae Include 1xRTT when updating set of RATs via "Allow 2G" toggle.
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
2021-02-27 00:11:01 +00:00
Yomna Nasser
6d65cb995b Adds Enable2gPreferenceController and unit tests.
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
2021-02-17 20:08:41 +00:00