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

Commit 54c35ae6 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Revert "Patch Set 2/2: Add an "Automatically Connect" option for WiFi networks"

This commit breaks 3rd party apps like Tasker.  It is being reverted until a better solution can be found.

This reverts commit 3d3d0a37

Change-Id: I31689838ec8be4aa33036ea75794cfbb7a69d109
parent 226d589d
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -167,15 +167,6 @@
            </LinearLayout>
        </LinearLayout>

        <LinearLayout android:id="@+id/wifi_auto_connect_toggle"
                    style="@style/wifi_item"
                    android:visibility="gone">
            <CheckBox android:id="@+id/wifi_auto_connect_togglebox"
                    style="@style/wifi_item_content"
                    android:textSize="14sp"
                    android:text="@string/wifi_auto_connect" />
        </LinearLayout>

        <LinearLayout android:id="@+id/wifi_advanced_toggle"
                    style="@style/wifi_item"
                    android:visibility="gone">
+0 −2
Original line number Diff line number Diff line
@@ -1320,8 +1320,6 @@
    <string name="wifi_required_info_text">To complete setup, your tablet needs access to Wi-Fi. After setup, you can switch between mobile data and Wi-Fi.</string>

    <!-- Dialog for Access Points --> <skip />
    <!-- Label for automatically_connect -->
    <string name="wifi_auto_connect">Automatically connect</string>
    <!-- Label to show/hide advanced options -->
    <string name="wifi_show_advanced">Show advanced options</string>
    <!-- Title for the WPS setup dialog [CHAR LIMIT=50] -->
+0 −3
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ class AccessPoint extends Preference {
    String bssid;
    int security;
    int networkId;
    boolean autoConnect;
    boolean wpsAvailable = false;

    PskType pskType = PskType.UNKNOWN;
@@ -188,7 +187,6 @@ class AccessPoint extends Preference {
        bssid = config.BSSID;
        security = getSecurity(config);
        networkId = config.networkId;
        autoConnect = config.autoConnect;
        mRssi = Integer.MAX_VALUE;
        mConfig = config;
    }
@@ -201,7 +199,6 @@ class AccessPoint extends Preference {
        if (security == SECURITY_PSK)
            pskType = getPskType(result);
        networkId = -1;
        autoConnect = true;
        mRssi = result.level;
        mScanResult = result;
    }
+0 −27
Original line number Diff line number Diff line
@@ -118,7 +118,6 @@ public class WifiConfigController implements TextWatcher,
    private IpAssignment mIpAssignment = IpAssignment.UNASSIGNED;
    private ProxySettings mProxySettings = ProxySettings.UNASSIGNED;
    private LinkProperties mLinkProperties = new LinkProperties();
    private boolean mAutoConnect;

    // True when this instance is used in SetupWizard XL context.
    private final boolean mInXlSetupWizard;
@@ -161,9 +160,6 @@ public class WifiConfigController implements TextWatcher,
        mProxySettingsSpinner = (Spinner) mView.findViewById(R.id.proxy_settings);
        mProxySettingsSpinner.setOnItemSelectedListener(this);

        boolean showAutoConnectField = false;
        boolean showAutoConnectFieldValue = false;

        if (mAccessPoint == null) { // new network
            mConfigUi.setTitle(R.string.wifi_add_network);

@@ -186,9 +182,6 @@ public class WifiConfigController implements TextWatcher,

            showIpConfigFields();
            showProxyFields();
            mView.findViewById(R.id.wifi_auto_connect_toggle).setVisibility(View.VISIBLE);
            ((CheckBox) mView.findViewById(R.id.wifi_auto_connect_togglebox)).setChecked(true);
            mView.findViewById(R.id.wifi_auto_connect_togglebox).setOnClickListener(this);
            mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
            mView.findViewById(R.id.wifi_advanced_togglebox).setOnClickListener(this);

@@ -237,25 +230,12 @@ public class WifiConfigController implements TextWatcher,
                } else {
                    mProxySettingsSpinner.setSelection(PROXY_NONE);
                }

                showAutoConnectField = true;
                showAutoConnectFieldValue = config.autoConnect;
            }

            if (mAccessPoint.networkId == INVALID_NETWORK_ID || mEdit) {
                showSecurityFields();
                showIpConfigFields();
                showProxyFields();
                mView.findViewById(R.id.wifi_auto_connect_toggle).setVisibility(View.VISIBLE);
                WifiConfiguration config = mAccessPoint.getConfig();
                if (mEdit) {
                    showAutoConnectField = false;
                    ((CheckBox) mView.findViewById(R.id.wifi_auto_connect_togglebox)).setChecked(config.autoConnect);
                } else {
                    mAutoConnect = true;
                    ((CheckBox) mView.findViewById(R.id.wifi_auto_connect_togglebox)).setChecked(true);
                }
                mView.findViewById(R.id.wifi_auto_connect_togglebox).setOnClickListener(this);
                mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
                mView.findViewById(R.id.wifi_advanced_togglebox).setOnClickListener(this);
                if (showAdvancedFields) {
@@ -264,10 +244,6 @@ public class WifiConfigController implements TextWatcher,
                }
            }

            if (showAutoConnectField) {
                addRow(group, R.string.wifi_auto_connect, (showAutoConnectFieldValue ? context.getString(R.string.yes) : context.getString(R.string.no)));
            }

            if (mEdit) {
                mConfigUi.setSubmitButton(context.getString(R.string.wifi_save));
            } else {
@@ -412,7 +388,6 @@ public class WifiConfigController implements TextWatcher,
        config.proxySettings = mProxySettings;
        config.ipAssignment = mIpAssignment;
        config.linkProperties = new LinkProperties(mLinkProperties);
        config.autoConnect = mAutoConnect;

        return config;
    }
@@ -777,8 +752,6 @@ public class WifiConfigController implements TextWatcher,
            } else {
                mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.GONE);
            }
        } else if (view.getId() == R.id.wifi_auto_connect_togglebox) {
            mAutoConnect = ((CheckBox) view).isChecked();
        }
    }