From 5353a4413684083df0e8ff2fbd6f5f256731bd28 Mon Sep 17 00:00:00 2001 From: Ningyuan Wang Date: Thu, 16 Mar 2017 15:13:32 -0700 Subject: Reset to default country code when phone is out of service Bug: 36229469 Test: compile, unit tests, manual test Change-Id: Ic6689cee5f559158cee16c3bf3072e96496f19c6 --- service/java/com/android/server/wifi/WifiCountryCode.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'service') 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) { -- cgit v1.2.3