Skip to content

Commit 668ec5e

Browse files
maniac103Gerrit Code Review
authored andcommitted
Merge "Wi-Fi: Pass default country code to driver" into cm-10.1
2 parents ad4e119 + 056ce7d commit 668ec5e

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

wifi/java/android/net/wifi/WifiNative.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ public boolean setSuspendOptimizations(boolean enabled) {
360360
}
361361

362362
public boolean setCountryCode(String countryCode) {
363-
if (countryCode == null) {
364-
// Ping the driver
365-
return doBooleanCommand("DRIVER COUNTRY");
366-
}
367363
return doBooleanCommand("DRIVER COUNTRY " + countryCode);
368364
}
369365

wifi/java/android/net/wifi/WifiStateMachine.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,14 +1347,14 @@ private void setCountryCode() {
13471347
setCountryCode(countryCode, false);
13481348
} else {
13491349
// On wifi-only devices, some drivers don't find hidden SSIDs unless DRIVER COUNTRY
1350-
// is called. Pinging the wifi driver without country code resolves this issue.
1350+
// is called. Use the default country code to ping the driver.
13511351
ConnectivityManager cm =
13521352
(ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
13531353
if (!cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) {
1354-
setCountryCode(null, false);
1354+
setCountryCode(mCountryCode, false);
13551355
}
13561356

1357-
// In other case, mmc tables from carrier do the trick of starting up the wifi driver
1357+
// In other case, mcc tables from carrier do the trick of starting up the wifi driver
13581358
}
13591359
}
13601360

@@ -2811,14 +2811,12 @@ public boolean processMessage(Message message) {
28112811
break;
28122812
case CMD_SET_COUNTRY_CODE:
28132813
String country = (String) message.obj;
2814-
if (DBG) log("set country code " + country);
28152814
String countryCode = country != null ? country.toUpperCase() : null;
2815+
if (DBG) log("set country code " + countryCode);
28162816
if (mWifiNative.setCountryCode(countryCode)) {
2817-
if (countryCode != null) {
2818-
mCountryCode = countryCode;
2819-
}
2817+
mCountryCode = countryCode;
28202818
} else {
2821-
loge("Failed to set country code " + country);
2819+
loge("Failed to set country code " + countryCode);
28222820
}
28232821
break;
28242822
case CMD_SET_FREQUENCY_BAND:

0 commit comments

Comments
 (0)