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

Commit b2639540 authored by qqzhou's avatar qqzhou Committed by Gerrit - the friendly Code Review server
Browse files

Settings: fix automatically connect wrongly in WLAN

When auto connect is unchecked and in Simplied-Chinese, the ap
still be automatically connected.
The reason is that the key for auto connect is used wrongly in
WifiSettings, it's not consistent with the key used in
AdvancedWifiSettings, so it cannot get corresponding value from
settings provider.

Will update with right key in WifiSettings.

Change-Id: I273f25307c98be3e52045723ec2bae8cbb72ee68
CRs-Fixed: 750963
parent 93700a07
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2706,7 +2706,6 @@
    <string name="wifi_advanced_network_netmask">掩码</string>
    <string name="bluetooth_dun_profile_summary_use_for">用于网络拨号</string>
    <string name="lock_to_app_start_step1">打开设置</string>
    <string name="wifi_autoconn_type">WIFI 自动连接类型</string>
    <string name="sub_activate_failed">启动失败</string>
    <string name="bluetooth_sap_profile_summary_use_for">用于SIM卡</string>
    <string name="sim_pin_enable_failed">无法启动PIN</string>

res/values/strings.xml

100644 → 100755
+0 −1
Original line number Diff line number Diff line
@@ -6206,7 +6206,6 @@
    <string name="wifi_auto_connect_type_title">Auto connect type</string>
    <string name="wifi_auto_connect_type_summary">Specify network connection type</string>
    <string name="wifi_menu_disconnect">Disconnect from network</string>
    <string name="wifi_autoconn_type">wifi_auto_connect_type</string>
    <string name="wifi_setting_connect_type_error">There was a problem setting the connect type.</string>
    <string name="cellular_to_wlan_title">Cellular->WLAN</string>
    <string name="usb_sdcard_summary">Lets you transfer media files in the SD card on computer</string>
+5 −2
Original line number Diff line number Diff line
@@ -120,6 +120,8 @@ public class WifiSettings extends RestrictedSettingsFragment
    private static final String SAVE_DIALOG_EDIT_MODE = "edit_mode";
    private static final String SAVE_DIALOG_ACCESS_POINT_STATE = "wifi_ap_state";

    private static final String WIFI_AUTO_CONNECT_TYPE = "wifi_auto_connect_type";

    private static boolean savedNetworksExist;

    private final IntentFilter mFilter;
@@ -381,8 +383,9 @@ public class WifiSettings extends RestrictedSettingsFragment
        }

        if (getResources().getBoolean(R.bool.config_auto_connect_wifi_enabled)) {
            mAutoConnect = Settings.System.getInt(getActivity().getContentResolver(),
                    getResources().getString(R.string.wifi_autoconn_type),
            mAutoConnect = Settings.System.getInt(
                    getActivity().getContentResolver(),
                    WIFI_AUTO_CONNECT_TYPE,
                    getResources().getInteger(R.integer.wifi_autoconn_type_auto)) ==
                    getResources().getInteger(R.integer.wifi_autoconn_type_auto);
        }