diff options
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r-- | wifi/java/android/net/wifi/WifiNative.java | 4 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java index 15d2378..54b758a 100644 --- a/wifi/java/android/net/wifi/WifiNative.java +++ b/wifi/java/android/net/wifi/WifiNative.java @@ -360,10 +360,6 @@ public class WifiNative { } public boolean setCountryCode(String countryCode) { - if (countryCode == null) { - // Ping the driver - return doBooleanCommand("DRIVER COUNTRY"); - } return doBooleanCommand("DRIVER COUNTRY " + countryCode); } diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index e823601..06a8562 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -1347,14 +1347,14 @@ public class WifiStateMachine extends StateMachine { setCountryCode(countryCode, false); } else { // On wifi-only devices, some drivers don't find hidden SSIDs unless DRIVER COUNTRY - // is called. Pinging the wifi driver without country code resolves this issue. + // is called. Use the default country code to ping the driver. ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); if (!cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) { - setCountryCode(null, false); + setCountryCode(mCountryCode, false); } - // In other case, mmc tables from carrier do the trick of starting up the wifi driver + // In other case, mcc tables from carrier do the trick of starting up the wifi driver } } @@ -2811,14 +2811,12 @@ public class WifiStateMachine extends StateMachine { break; case CMD_SET_COUNTRY_CODE: String country = (String) message.obj; - if (DBG) log("set country code " + country); String countryCode = country != null ? country.toUpperCase() : null; + if (DBG) log("set country code " + countryCode); if (mWifiNative.setCountryCode(countryCode)) { - if (countryCode != null) { - mCountryCode = countryCode; - } + mCountryCode = countryCode; } else { - loge("Failed to set country code " + country); + loge("Failed to set country code " + countryCode); } break; case CMD_SET_FREQUENCY_BAND: |