diff options
author | Ningyuan Wang <nywang@google.com> | 2017-03-16 15:13:32 -0700 |
---|---|---|
committer | Ningyuan Wang <nywang@google.com> | 2017-03-18 20:15:32 +0000 |
commit | 5353a4413684083df0e8ff2fbd6f5f256731bd28 (patch) | |
tree | cae5701bd3a2b4468b214f5d6a9efcb1ed4121ab /service | |
parent | 9b7ac0c52f2a5d6a4e409e902692c437698c52b6 (diff) |
Reset to default country code when phone is out of service
Bug: 36229469
Test: compile, unit tests, manual test
Change-Id: Ic6689cee5f559158cee16c3bf3072e96496f19c6
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiCountryCode.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiCountryCode.java b/service/java/com/android/server/wifi/WifiCountryCode.java index 58bf90fa0..e69fb8e1c 100644 --- a/service/java/com/android/server/wifi/WifiCountryCode.java +++ b/service/java/com/android/server/wifi/WifiCountryCode.java @@ -131,12 +131,13 @@ public class WifiCountryCode { */ public synchronized boolean setCountryCode(String countryCode) { if (DBG) Log.d(TAG, "Receive set country code request: " + countryCode); - // Ignore empty country code. + // Empty country code. if (TextUtils.isEmpty(countryCode)) { - if (DBG) Log.d(TAG, "Ignore empty country code"); - return false; + if (DBG) Log.d(TAG, "Received empty country code, reset to default country code"); + mTelephonyCountryCode = null; + } else { + mTelephonyCountryCode = countryCode.toUpperCase(); } - mTelephonyCountryCode = countryCode.toUpperCase(); // If wpa_supplicant is ready we set the country code now, otherwise it will be // set once wpa_supplicant is ready. if (mReady) { |