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

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

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

parents c3733d88 b0b399af
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