summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-01-23 01:48:37 +0100
committerJorge Ruesga <jorge@ruesga.com>2013-01-23 01:48:37 +0100
commit056ce7dab71a2157ba2c928d86347ae65f0716d8 (patch)
tree553b8fff559077955377e1f41f097e4538785a8c /wifi
parent788c20d2768be246c8417ffd6505b94c1f0c45b7 (diff)
downloadframeworks_base-056ce7dab71a2157ba2c928d86347ae65f0716d8.zip
frameworks_base-056ce7dab71a2157ba2c928d86347ae65f0716d8.tar.gz
frameworks_base-056ce7dab71a2157ba2c928d86347ae65f0716d8.tar.bz2
Wi-Fi: Pass default country code to driver
This patch reverts partially the change http://review.cyanogenmod.org/#/c/28918/8, and passing the default country code ("GB") to the driver instead of null. Change-Id: I7d7115155a0a52261931ffaddaf35f316d095800 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiNative.java4
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java14
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: