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

Commit 668ec5e6 authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "Wi-Fi: Pass default country code to driver" into cm-10.1

parents ad4e119d 056ce7da
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: