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

Commit 02e712ce authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove Connect/Disconnect button dependence on WifiEntry.isExpired()" into rvc-dev

parents 2e5da48c 0ddc3675
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -666,17 +666,10 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle

        mButtonsPref.setButton1Visible(canForgetNetwork);
        mButtonsPref.setButton2Visible(showCaptivePortalButton);
        // If it's expired and connected, shows Disconnect button for users to disconnect it.
        // If it's expired and not connected, hides the button and users are not able to connect it.
        //
        // expired connected    visibility
        // false   false        true    show (Connect) button
        // false   true         true    show (Disconnect) button
        // true    false        false   hide button
        // true    true         true    show (Disconnect) button
        mButtonsPref.setButton3Visible(mWifiEntry.getLevel() != WifiEntry.WIFI_LEVEL_UNREACHABLE
                && (!mWifiEntry.isExpired()
                        || mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTED));
        // Keep the connect/disconnected button visible if we can connect/disconnect, or if we are
        // in the middle of connecting (greyed out).
        mButtonsPref.setButton3Visible(canConnectDisconnectNetwork
                || mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTING);
        mButtonsPref.setButton3Enabled(canConnectDisconnectNetwork);
        mButtonsPref.setButton3Text(getConnectDisconnectButtonTextResource());
        mButtonsPref.setButton3Icon(getConnectDisconnectButtonIconResource());