Skip to content
Snippets Groups Projects
Commit 05f42bf1 authored by tomhsu's avatar tomhsu
Browse files

Avoid NTN info show on InternetDialog.

Flag: NA
Fix: 331293967
Test: Manual test
Test: atest passed
Change-Id: I9f7beb7e6e3cf39e7346a8f81b0093a5f7946364
parent 3c2f0a5e
No related branches found
No related tags found
No related merge requests found
......@@ -936,6 +936,10 @@ public class InternetDialogController implements AccessPointController.AccessPoi
mHasActiveSubIdOnDds = false;
Log.e(TAG, "Can't get DDS subscriptionInfo");
return;
} else if (ddsSubInfo.isOnlyNonTerrestrialNetwork()) {
mHasActiveSubIdOnDds = false;
Log.d(TAG, "This is NTN, so do not show mobile data");
return;
}
mHasActiveSubIdOnDds = isEmbeddedSubscriptionVisible(ddsSubInfo);
......
......@@ -14,7 +14,9 @@ import static com.android.systemui.qs.tiles.dialog.InternetDialogController.TOAS
import static com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_MAX;
import static com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_MIN;
import static com.android.wifitrackerlib.WifiEntry.WIFI_LEVEL_UNREACHABLE;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
......@@ -1101,6 +1103,34 @@ public class InternetDialogDelegateControllerTest extends SysuiTestCase {
assertThat(mInternetDialogController.hasActiveSubIdOnDds()).isFalse();
}
@Test
public void hasActiveSubIdOnDds_activeDdsAndIsOnlyNonTerrestrialNetwork_returnFalse() {
when(SubscriptionManager.getDefaultDataSubscriptionId())
.thenReturn(SUB_ID);
SubscriptionInfo info = mock(SubscriptionInfo.class);
when(info.isEmbedded()).thenReturn(true);
when(info.isOnlyNonTerrestrialNetwork()).thenReturn(true);
when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(info);
mInternetDialogController.mOnSubscriptionsChangedListener.onSubscriptionsChanged();
assertFalse(mInternetDialogController.hasActiveSubIdOnDds());
}
@Test
public void hasActiveSubIdOnDds_activeDdsAndIsNotOnlyNonTerrestrialNetwork_returnTrue() {
when(SubscriptionManager.getDefaultDataSubscriptionId())
.thenReturn(SUB_ID);
SubscriptionInfo info = mock(SubscriptionInfo.class);
when(info.isEmbedded()).thenReturn(true);
when(info.isOnlyNonTerrestrialNetwork()).thenReturn(false);
when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(info);
mInternetDialogController.mOnSubscriptionsChangedListener.onSubscriptionsChanged();
assertTrue(mInternetDialogController.hasActiveSubIdOnDds());
}
private String getResourcesString(String name) {
return mContext.getResources().getString(getResourcesId(name));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment