Add new warning dialogue when user is Resetting mobile network settings.
If the user is reseting mobile network settings and have all these conditions: - No Wi-fi - Has check to delete all eSIMs - Has a least one RAC sim carrier Then show the warning dialogue. Test: make, manually test, atest SubSettingLauncherTest, atest ResetNetworkTest, atest SubscriptionUtilTest Bug: 328649510 Change-Id: I47d9b868b649b259d5e4008ec742317d2cb7cf51
This commit is contained in:
@@ -649,6 +649,39 @@ public class SubscriptionUtilTest {
|
||||
assertFalse(SubscriptionUtil.isConnectedToWifi(mContext));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasSubscriptionWithRacCarrier_hasNoWifi_showRacDialog_returnTrue() {
|
||||
when(mResources.getIntArray(anyInt())).thenReturn(CARRIERS_THAT_USE_RAC);
|
||||
final SubscriptionInfo info = mock(SubscriptionInfo.class);
|
||||
when(info.getCarrierId()).thenReturn(RAC_CARRIER_ID);
|
||||
when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info));
|
||||
addNetworkTransportType(NetworkCapabilities.TRANSPORT_BLUETOOTH);
|
||||
|
||||
assertTrue(SubscriptionUtil.shouldShowRacDialog(mContext));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasSubscriptionWithRacCarrier_hasWifi_showRacDialog_returnFalse() {
|
||||
when(mResources.getIntArray(anyInt())).thenReturn(CARRIERS_THAT_USE_RAC);
|
||||
final SubscriptionInfo info = mock(SubscriptionInfo.class);
|
||||
when(info.getCarrierId()).thenReturn(RAC_CARRIER_ID);
|
||||
when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info));
|
||||
addNetworkTransportType(NetworkCapabilities.TRANSPORT_WIFI);
|
||||
|
||||
assertFalse(SubscriptionUtil.shouldShowRacDialog(mContext));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasNoSubscriptionWithRacCarrier_hasNoWifi_showRacDialog_returnFalse() {
|
||||
when(mResources.getIntArray(anyInt())).thenReturn(CARRIERS_THAT_USE_RAC);
|
||||
final SubscriptionInfo info = mock(SubscriptionInfo.class);
|
||||
when(info.getCarrierId()).thenReturn(NO_RAC_CARRIER_ID);
|
||||
when(mSubMgr.getAvailableSubscriptionInfoList()).thenReturn(Arrays.asList(info));
|
||||
addNetworkTransportType(NetworkCapabilities.TRANSPORT_WIFI);
|
||||
|
||||
assertFalse(SubscriptionUtil.shouldShowRacDialog(mContext));
|
||||
}
|
||||
|
||||
private void addNetworkTransportType(int networkType) {
|
||||
mNetworkCapabilities =
|
||||
new NetworkCapabilities.Builder().addTransportType(networkType).build();
|
||||
|
Reference in New Issue
Block a user