diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index 3f7d73bb4..bd8129a38 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -3430,6 +3430,25 @@ public class WifiServiceImplTest { } /** + * Verifies that entering airplane mode does not reset country code. + */ + @Test + public void testEnterAirplaneModeNotResetCountryCode() { + mWifiServiceImpl.checkAndStartWifi(); + verify(mContext).registerReceiver(mBroadcastReceiverCaptor.capture(), + (IntentFilter) argThat((IntentFilter filter) -> + filter.hasAction(Intent.ACTION_AIRPLANE_MODE_CHANGED))); + + when(mSettingsStore.isAirplaneModeOn()).thenReturn(true); + + // Send the broadcast + Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); + mBroadcastReceiverCaptor.getValue().onReceive(mContext, intent); + + verifyNoMoreInteractions(mWifiCountryCode); + } + + /** * Verify calls to notify users of a softap config change check the NETWORK_SETTINGS permission. */ @Test |