Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 056ce7da authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

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: default avatarJorge Ruesga <jorge@ruesga.com>
parent 788c20d2
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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);
    }

+6 −8
Original line number Diff line number Diff line
@@ -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;
                        }
                    } else {
                        loge("Failed to set country code " + country);
                        loge("Failed to set country code " + countryCode);
                    }
                    break;
                case CMD_SET_FREQUENCY_BAND: