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

Commit c23daaa7 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "[SB Refactor] Don't display the wifi icon if wifi isn't default." into tm-qpr-dev

parents c2936af3 581ae211
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -124,7 +124,8 @@ constructor(
                    isDefault -> icon
                    wifiConstants.alwaysShowIconIfEnabled -> icon
                    !connectivityConstants.hasDataCapabilities -> icon
                    wifiNetwork is WifiNetworkModel.Active && wifiNetwork.isValidated -> icon
                    // See b/272509965: Even if we have an active and validated wifi network, we
                    // don't want to show the icon if wifi isn't the default network.
                    else -> WifiIcon.Hidden
                }
            }
+11 −14
Original line number Diff line number Diff line
@@ -368,40 +368,37 @@ internal class WifiViewModelIconParameterizedTest(private val testCase: TestCase

                // network = CarrierMerged => not shown
                TestCase(
                    enabled = true,
                    isDefault = true,
                    forceHidden = false,
                    network =
                        WifiNetworkModel.CarrierMerged(NETWORK_ID, subscriptionId = 1, level = 1),
                    expected = null,
                ),

                // network = Inactive => not shown
                // isDefault = false => no networks shown
                TestCase(
                    isDefault = false,
                    network = WifiNetworkModel.Inactive,
                    expected = null,
                ),

                // network = Unavailable => not shown
                TestCase(
                    isDefault = false,
                    network = WifiNetworkModel.Unavailable,
                    expected = null,
                ),

                // network = Active & validated = false => not shown
                TestCase(
                    isDefault = false,
                    network = WifiNetworkModel.Active(NETWORK_ID, isValidated = false, level = 3),
                    expected = null,
                ),

                // network = Active & validated = true => shown
                // Even though this network is active and validated, we still doesn't want it shown
                // because wifi isn't the default connection (b/272509965).
                TestCase(
                    isDefault = false,
                    network = WifiNetworkModel.Active(NETWORK_ID, isValidated = true, level = 4),
                    expected =
                        Expected(
                            iconResource = WIFI_FULL_ICONS[4],
                            contentDescription = { context ->
                                context.getString(WIFI_CONNECTION_STRENGTH[4])
                            },
                            description = "Full internet level 4 icon",
                        ),
                    expected = null,
                ),
            )
    }