summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Caitlin Shkuratov <caitlinshk@google.com> 2023-05-05 20:39:49 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-05 20:39:49 +0000
commite7f2e5bc5680558b7463de77dd5c20b4b5a438b6 (patch)
tree796e6e6ae024dc192efdb765f799325a2b363d53
parentd5b4b9b9500ed93f7ef34e1dfbd4b63f080321a2 (diff)
parent970a8f60258a2ae2c8f4b9528a37808dda45fcc1 (diff)
Merge "[SB Refactor] Use the calculated mobileIsDefault for failed connection." into udc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt15
2 files changed, 16 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt
index eec91a0bca82..e1ffae01be03 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt
@@ -259,7 +259,7 @@ constructor(
*/
override val isDefaultConnectionFailed: StateFlow<Boolean> =
combine(
- mobileConnectionsRepo.mobileIsDefault,
+ mobileIsDefault,
mobileConnectionsRepo.defaultConnectionIsValidated,
forcingCellularValidation,
) { mobileIsDefault, defaultConnectionIsValidated, forcingCellularValidation ->
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt
index 6e1ab58db56d..1c219da09e27 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt
@@ -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() =