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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21937135

Change-Id: Ifed95b4b2260cb552525cdd931d2bfcd79b4f677
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Caitlin Shkuratov
2023-03-13 14:39:28 +00:00
committed by Automerger Merge Worker
2 changed files with 13 additions and 15 deletions

View File

@@ -124,7 +124,8 @@ constructor(
isDefault -> icon isDefault -> icon
wifiConstants.alwaysShowIconIfEnabled -> icon wifiConstants.alwaysShowIconIfEnabled -> icon
!connectivityConstants.hasDataCapabilities -> 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 else -> WifiIcon.Hidden
} }
} }

View File

@@ -368,40 +368,37 @@ internal class WifiViewModelIconParameterizedTest(private val testCase: TestCase
// network = CarrierMerged => not shown // network = CarrierMerged => not shown
TestCase( TestCase(
enabled = true,
isDefault = true,
forceHidden = false,
network = network =
WifiNetworkModel.CarrierMerged(NETWORK_ID, subscriptionId = 1, level = 1), WifiNetworkModel.CarrierMerged(NETWORK_ID, subscriptionId = 1, level = 1),
expected = null, expected = null,
), ),
// network = Inactive => not shown // isDefault = false => no networks shown
TestCase( TestCase(
isDefault = false,
network = WifiNetworkModel.Inactive, network = WifiNetworkModel.Inactive,
expected = null, expected = null,
), ),
// network = Unavailable => not shown
TestCase( TestCase(
isDefault = false,
network = WifiNetworkModel.Unavailable, network = WifiNetworkModel.Unavailable,
expected = null, expected = null,
), ),
// network = Active & validated = false => not shown
TestCase( TestCase(
isDefault = false,
network = WifiNetworkModel.Active(NETWORK_ID, isValidated = false, level = 3), network = WifiNetworkModel.Active(NETWORK_ID, isValidated = false, level = 3),
expected = null, 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( TestCase(
isDefault = false,
network = WifiNetworkModel.Active(NETWORK_ID, isValidated = true, level = 4), network = WifiNetworkModel.Active(NETWORK_ID, isValidated = true, level = 4),
expected = expected = null,
Expected(
iconResource = WIFI_FULL_ICONS[4],
contentDescription = { context ->
context.getString(WIFI_CONNECTION_STRENGTH[4])
},
description = "Full internet level 4 icon",
),
), ),
) )
} }