diff options
| author | 2021-12-05 21:03:31 +0800 | |
|---|---|---|
| committer | 2021-12-05 21:03:31 +0800 | |
| commit | ffcf558ae0e7f7a1ab785efe3927e335f1525130 (patch) | |
| tree | 03b90b274840decfa4bb01f06ad04bf936cb147e | |
| parent | 535795b36d46b520cac1565b16027d3140ed1430 (diff) | |
[Provider Model] Refine sub-title (QS Internet Dialog)
- Show "No other networks available" when W+ connected only without
other WiFi networks
- See b/207470178#comment14 for a screenshot.
Bug: 207470178
Test: manual test
atest -c InternetDialogControllerTest
Change-Id: I7d2b5672d8e56b23aa81c1bc291abc2406b85287
2 files changed, 15 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java index 6f63a08c6c0f..bbbb76481a95 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java @@ -348,6 +348,10 @@ public class InternetDialogController implements AccessPointController.AccessPoi return mContext.getText(SUBTITLE_TEXT_SEARCHING_FOR_NETWORKS); } + if (isCarrierNetworkActive()) { + return mContext.getText(SUBTITLE_TEXT_NON_CARRIER_NETWORK_UNAVAILABLE); + } + // Sub-Title: // show non_carrier_network_unavailable // - while Wi-Fi on + no Wi-Fi item diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java index 95e7a98c0a60..61c91f5cefe4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java @@ -159,7 +159,6 @@ public class InternetDialogControllerTest extends SysuiTestCase { mAccessPoints.add(mWifiEntry1); when(mAccessPointController.getMergedCarrierEntry()).thenReturn(mMergedCarrierEntry); when(mSubscriptionManager.getActiveSubscriptionIdList()).thenReturn(new int[]{SUB_ID}); - when(mAccessPointController.getMergedCarrierEntry()).thenReturn(mMergedCarrierEntry); when(mToastFactory.createToast(any(), anyString(), anyString(), anyInt(), anyInt())) .thenReturn(mSystemUIToast); when(mSystemUIToast.getView()).thenReturn(mToastView); @@ -335,6 +334,17 @@ public class InternetDialogControllerTest extends SysuiTestCase { } @Test + public void getSubtitleText_withCarrierNetworkActiveOnly_returnNoOtherAvailable() { + fakeAirplaneModeEnabled(false); + when(mWifiManager.isWifiEnabled()).thenReturn(true); + mInternetDialogController.onAccessPointsChanged(null /* accessPoints */); + when(mMergedCarrierEntry.isDefaultNetwork()).thenReturn(true); + + assertThat(mInternetDialogController.getSubtitleText(false)) + .isEqualTo(getResourcesString("non_carrier_network_unavailable")); + } + + @Test public void getWifiDetailsSettingsIntent_withNoKey_returnNull() { assertThat(mInternetDialogController.getWifiDetailsSettingsIntent(null)).isNull(); } |