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

Commit b0b399af authored by Evan Laird's avatar Evan Laird
Browse files

Don't show Wi-Fi indicator until it is validated

This change makes it so that we won't show the Wi-Fi indicator in the
status bar unless it is validated. So we shouldn't ever see the
indicator with an 'x' on it

Test: atest SystemUITests; manual
Bug: 136473125
Change-Id: I14cf8dd8387a5df569f897a27ffe59bf4bdf27f8
parent d02b11f6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -85,7 +85,8 @@ public class WifiSignalController extends
        boolean visibleWhenEnabled = mContext.getResources().getBoolean(
                R.bool.config_showWifiIndicatorWhenEnabled);
        boolean wifiVisible = mCurrentState.enabled
                && (mCurrentState.connected || !mHasMobileData || visibleWhenEnabled);
                && ((mCurrentState.connected && mCurrentState.inetCondition == 1)
                    || !mHasMobileData || visibleWhenEnabled);
        String wifiDesc = wifiVisible ? mCurrentState.ssid : null;
        boolean ssidPresent = wifiVisible && mCurrentState.ssid != null;
        String contentDescription = getStringIfExists(getContentDescription());
+6 −4
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {

        setWifiState(true, testSsid);
        setWifiLevel(0);
        verifyLastWifiIcon(true, WifiIcons.WIFI_SIGNAL_STRENGTH[0][0]);
        // Connected, but still not validated - does not show
        verifyLastWifiIcon(false, WifiIcons.WIFI_SIGNAL_STRENGTH[0][0]);

        for (int testLevel = 0; testLevel < WifiIcons.WIFI_LEVEL_COUNT; testLevel++) {
            setWifiLevel(testLevel);
@@ -47,7 +48,8 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
            setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_WIFI, true, true);
            verifyLastWifiIcon(true, WifiIcons.WIFI_SIGNAL_STRENGTH[1][testLevel]);
            setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_WIFI, false, true);
            verifyLastWifiIcon(true, WifiIcons.WIFI_SIGNAL_STRENGTH[0][testLevel]);
            // Icon does not show if not validated
            verifyLastWifiIcon(false, WifiIcons.WIFI_SIGNAL_STRENGTH[0][testLevel]);
        }
    }

@@ -70,7 +72,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
                    testSsid);
            setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_WIFI, false, true);
            verifyLastQsWifiIcon(true, true, WifiIcons.QS_WIFI_SIGNAL_STRENGTH[0][testLevel],
                    testSsid);
                    null);
        }
    }

@@ -132,7 +134,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
        verifyLastWifiIcon(true, WifiIcons.WIFI_SIGNAL_STRENGTH[1][testLevel]);

        setConnectivityViaCallback(NetworkCapabilities.TRANSPORT_WIFI, false, true);
        verifyLastWifiIcon(true, WifiIcons.WIFI_SIGNAL_STRENGTH[0][testLevel]);
        verifyLastWifiIcon(false, WifiIcons.WIFI_SIGNAL_STRENGTH[0][testLevel]);
    }

    @Test