Merge "[SB Refactor] Use the calculated mobileIsDefault for failed connection." into udc-dev am: e7f2e5bc56

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

Change-Id: I435612d780d70386e9d60bb96a14b942c5cb1ee4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Caitlin Shkuratov
2023-05-05 20:42:49 +00:00
committed by Automerger Merge Worker
2 changed files with 16 additions and 1 deletions

View File

@@ -259,7 +259,7 @@ constructor(
*/
override val isDefaultConnectionFailed: StateFlow<Boolean> =
combine(
mobileConnectionsRepo.mobileIsDefault,
mobileIsDefault,
mobileConnectionsRepo.defaultConnectionIsValidated,
forcingCellularValidation,
) { mobileIsDefault, defaultConnectionIsValidated, forcingCellularValidation ->

View File

@@ -361,6 +361,21 @@ class MobileIconsInteractorTest : SysuiTestCase() {
job.cancel()
}
@Test
fun failedConnection_carrierMergedDefault_notValidated_failed() =
testScope.runTest {
var latest: Boolean? = null
val job = underTest.isDefaultConnectionFailed.onEach { latest = it }.launchIn(this)
connectionsRepository.hasCarrierMergedConnection.value = true
connectionsRepository.defaultConnectionIsValidated.value = false
yield()
assertThat(latest).isTrue()
job.cancel()
}
/** Regression test for b/275076959. */
@Test
fun failedConnection_dataSwitchInSameGroup_notFailed() =