summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiCountryCodeTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiCountryCodeTest.java b/tests/wifitests/src/com/android/server/wifi/WifiCountryCodeTest.java
index fa35e8b5d..33aab60e1 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiCountryCodeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiCountryCodeTest.java
@@ -167,4 +167,21 @@ public class WifiCountryCodeTest {
verify(mWifiNative, times(2)).setCountryCode(anyString());
assertEquals(mDefaultCountryCode, mWifiCountryCode.getCountryCodeSentToDriver());
}
+
+ /**
+ * Test if we can reset to the default country code when phone is out of service.
+ * Telephony service calls |setCountryCode| with an empty string when phone is out of service.
+ * In this case we should fall back to the default country code.
+ * @throws Exception
+ */
+ @Test
+ public void resetCountryCodeWhenOutOfService() throws Exception {
+ assertEquals(mDefaultCountryCode, mWifiCountryCode.getCountryCode());
+ mWifiCountryCode.setCountryCode(mTelephonyCountryCode);
+ assertEquals(mTelephonyCountryCode, mWifiCountryCode.getCountryCode());
+ // Out of service.
+ mWifiCountryCode.setCountryCode("");
+ assertEquals(mDefaultCountryCode, mWifiCountryCode.getCountryCode());
+ }
+
}