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

Commit 3ea0c99b authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Revert "Use a build-specific wifi country code"

This reverts commit c33cd23c.

bug:11064682
Change-Id: I35825a7005e75f3abf02f23f31dee1cb7b101c31
parent c33cd23c
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -2797,6 +2797,7 @@ public final class Settings {
            MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
            MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
            MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
            MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
            MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
            MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
            MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
@@ -5206,6 +5207,12 @@ public final class Settings {
       public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
       public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
               "wifi_networks_available_repeat_delay";
               "wifi_networks_available_repeat_delay";


       /**
        * 802.11 country code in ISO 3166 format
        * @hide
        */
       public static final String WIFI_COUNTRY_CODE = "wifi_country_code";

       /**
       /**
        * The interval in milliseconds to issue wake up scans when wifi needs
        * The interval in milliseconds to issue wake up scans when wifi needs
        * to connect. This is necessary to connect to an access point when
        * to connect. This is necessary to connect to an access point when
+0 −4
Original line number Original line Diff line number Diff line
@@ -352,10 +352,6 @@
    <!-- Wifi driver supports batched scan -->
    <!-- Wifi driver supports batched scan -->
    <bool translatable="false" name="config_wifi_batched_scan_supported">false</bool>
    <bool translatable="false" name="config_wifi_batched_scan_supported">false</bool>


    <!-- Default wifi country code.  If the device is going to be sold in the US this
         needs to be US.  Uses ISO 3166 country code -->
    <string translatable="false" name="config_wifi_default_country_code">US</string>

    <!-- Flag indicating whether the we should enable the automatic brightness in Settings.
    <!-- Flag indicating whether the we should enable the automatic brightness in Settings.
         Software implementation will be used if config_hardware_auto_brightness_available is not set -->
         Software implementation will be used if config_hardware_auto_brightness_available is not set -->
    <bool name="config_automatic_brightness_available">false</bool>
    <bool name="config_automatic_brightness_available">false</bool>
+0 −1
Original line number Original line Diff line number Diff line
@@ -817,7 +817,6 @@
  <java-symbol type="string" name="wifi_tether_configure_ssid_default" />
  <java-symbol type="string" name="wifi_tether_configure_ssid_default" />
  <java-symbol type="string" name="wifi_watchdog_network_disabled" />
  <java-symbol type="string" name="wifi_watchdog_network_disabled" />
  <java-symbol type="string" name="wifi_watchdog_network_disabled_detailed" />
  <java-symbol type="string" name="wifi_watchdog_network_disabled_detailed" />
  <java-symbol type="string" name="config_wifi_default_country_code" />
  <java-symbol type="string" name="imei" />
  <java-symbol type="string" name="imei" />
  <java-symbol type="string" name="meid" />
  <java-symbol type="string" name="meid" />
  <java-symbol type="string" name="granularity_label_character" />
  <java-symbol type="string" name="granularity_label_character" />
+12 −2
Original line number Original line Diff line number Diff line
@@ -1456,6 +1456,9 @@ public class WifiStateMachine extends StateMachine {
    public void setCountryCode(String countryCode, boolean persist) {
    public void setCountryCode(String countryCode, boolean persist) {
        if (persist) {
        if (persist) {
            mPersistedCountryCode = countryCode;
            mPersistedCountryCode = countryCode;
            Settings.Global.putString(mContext.getContentResolver(),
                    Settings.Global.WIFI_COUNTRY_CODE,
                    countryCode);
        }
        }
        sendMessage(CMD_SET_COUNTRY_CODE, countryCode);
        sendMessage(CMD_SET_COUNTRY_CODE, countryCode);
        mWifiP2pChannel.sendMessage(WifiP2pService.SET_COUNTRY_CODE, countryCode);
        mWifiP2pChannel.sendMessage(WifiP2pService.SET_COUNTRY_CODE, countryCode);
@@ -1688,8 +1691,8 @@ public class WifiStateMachine extends StateMachine {
     * Set the country code from the system setting value, if any.
     * Set the country code from the system setting value, if any.
     */
     */
    private void setCountryCode() {
    private void setCountryCode() {
        String countryCode = mContext.getResources().getString(
        String countryCode = Settings.Global.getString(mContext.getContentResolver(),
                                    R.string.config_wifi_default_country_code);
                Settings.Global.WIFI_COUNTRY_CODE);
        if (countryCode != null && !countryCode.isEmpty()) {
        if (countryCode != null && !countryCode.isEmpty()) {
            setCountryCode(countryCode, false);
            setCountryCode(countryCode, false);
        } else {
        } else {
@@ -2414,6 +2417,13 @@ public class WifiStateMachine extends StateMachine {
                case CMD_BOOT_COMPLETED:
                case CMD_BOOT_COMPLETED:
                    String countryCode = mPersistedCountryCode;
                    String countryCode = mPersistedCountryCode;
                    if (TextUtils.isEmpty(countryCode) == false) {
                    if (TextUtils.isEmpty(countryCode) == false) {
                        Settings.Global.putString(mContext.getContentResolver(),
                                Settings.Global.WIFI_COUNTRY_CODE,
                                countryCode);
                        // it may be that the state transition that should send this info
                        // to the driver happened between mPersistedCountryCode getting set
                        // and now, so simply persisting it here would mean we have sent
                        // nothing to the driver.  Send the cmd so it might be set now.
                        sendMessageAtFrontOfQueue(CMD_SET_COUNTRY_CODE, countryCode);
                        sendMessageAtFrontOfQueue(CMD_SET_COUNTRY_CODE, countryCode);
                    }
                    }
                    break;
                    break;
+6 −0
Original line number Original line Diff line number Diff line
@@ -2545,6 +2545,12 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
        mServiceTransactionId = 0;
        mServiceTransactionId = 0;
        mServiceDiscReqId = null;
        mServiceDiscReqId = null;


        String countryCode = Settings.Global.getString(mContext.getContentResolver(),
                Settings.Global.WIFI_COUNTRY_CODE);
        if (countryCode != null && !countryCode.isEmpty()) {
            mP2pStateMachine.sendMessage(SET_COUNTRY_CODE, countryCode);
        }

        updatePersistentNetworks(RELOAD);
        updatePersistentNetworks(RELOAD);
    }
    }