summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index a9d7f0ce2..fd1ef1718 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -1114,6 +1114,23 @@ public class ClientModeImplTest extends WifiBaseTest {
}
/**
+ * When the SIM card was removed, if the current wifi connection is using it, the connection
+ * should be disconnected, otherwise, the connection shouldn't be impacted.
+ */
+ @Test
+ public void testResetSimWhenConnectedSimRemovedAfterNetworkRemoval() throws Exception {
+ setupEapSimConnection();
+ doReturn(false).when(mWifiCarrierInfoManager).isSimPresent(eq(DATA_SUBID));
+ when(mWifiConfigManager.getConfiguredNetwork(anyInt())).thenReturn(null);
+ mCmi.sendMessage(ClientModeImpl.CMD_RESET_SIM_NETWORKS,
+ ClientModeImpl.RESET_SIM_REASON_SIM_REMOVED);
+ mLooper.dispatchAll();
+
+ verify(mSimRequiredNotifier, never()).showSimRequiredNotification(any(), any());
+ assertEquals("ObtainingIpState", getCurrentState().getName());
+ }
+
+ /**
* When the default data SIM is changed, if the current wifi connection is carrier wifi,
* the connection should be disconnected.
*/