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

This commit is contained in:
TreeHugger Robot
2020-05-05 12:33:28 +00:00
committed by Android (Google) Code Review

View File

@@ -666,17 +666,10 @@ public class WifiDetailPreferenceController2 extends AbstractPreferenceControlle
mButtonsPref.setButton1Visible(canForgetNetwork); mButtonsPref.setButton1Visible(canForgetNetwork);
mButtonsPref.setButton2Visible(showCaptivePortalButton); mButtonsPref.setButton2Visible(showCaptivePortalButton);
// If it's expired and connected, shows Disconnect button for users to disconnect it. // Keep the connect/disconnected button visible if we can connect/disconnect, or if we are
// If it's expired and not connected, hides the button and users are not able to connect it. // in the middle of connecting (greyed out).
// mButtonsPref.setButton3Visible(canConnectDisconnectNetwork
// expired connected visibility || mWifiEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTING);
// 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));
mButtonsPref.setButton3Enabled(canConnectDisconnectNetwork); mButtonsPref.setButton3Enabled(canConnectDisconnectNetwork);
mButtonsPref.setButton3Text(getConnectDisconnectButtonTextResource()); mButtonsPref.setButton3Text(getConnectDisconnectButtonTextResource());
mButtonsPref.setButton3Icon(getConnectDisconnectButtonIconResource()); mButtonsPref.setButton3Icon(getConnectDisconnectButtonIconResource());