Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModelTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,21 @@ class MobileIconViewModelTest : SysuiTestCase() { job.cancel() } @Test fun isVisible_satellite_respectsAirplaneMode() = testScope.runTest { val latest by collectLastValue(underTest.isVisible) repository.isNonTerrestrial.value = true airplaneModeInteractor.setIsAirplaneMode(false) assertThat(latest).isTrue() airplaneModeInteractor.setIsAirplaneMode(true) assertThat(latest).isFalse() } @Test fun contentDescription_notInService_usesNoPhone() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModel.kt +13 −2 Original line number Diff line number Diff line Loading @@ -94,7 +94,12 @@ class MobileIconViewModel( } private val satelliteProvider by lazy { CarrierBasedSatelliteViewModelImpl(subscriptionId, iconInteractor) CarrierBasedSatelliteViewModelImpl( subscriptionId, airplaneModeInteractor, iconInteractor, scope, ) } /** Loading Loading @@ -145,9 +150,15 @@ class MobileIconViewModel( /** Representation of this network when it is non-terrestrial (e.g., satellite) */ private class CarrierBasedSatelliteViewModelImpl( override val subscriptionId: Int, airplaneModeInteractor: AirplaneModeInteractor, interactor: MobileIconInteractor, scope: CoroutineScope, ) : MobileIconViewModelCommon { override val isVisible: StateFlow<Boolean> = MutableStateFlow(true) override val isVisible: StateFlow<Boolean> = airplaneModeInteractor.isAirplaneMode .map { !it } .stateIn(scope, SharingStarted.WhileSubscribed(), false) override val icon: Flow<SignalIconModel> = interactor.signalLevelIcon override val contentDescription: Flow<MobileContentDescription?> = MutableStateFlow(null) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModelTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,21 @@ class MobileIconViewModelTest : SysuiTestCase() { job.cancel() } @Test fun isVisible_satellite_respectsAirplaneMode() = testScope.runTest { val latest by collectLastValue(underTest.isVisible) repository.isNonTerrestrial.value = true airplaneModeInteractor.setIsAirplaneMode(false) assertThat(latest).isTrue() airplaneModeInteractor.setIsAirplaneMode(true) assertThat(latest).isFalse() } @Test fun contentDescription_notInService_usesNoPhone() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModel.kt +13 −2 Original line number Diff line number Diff line Loading @@ -94,7 +94,12 @@ class MobileIconViewModel( } private val satelliteProvider by lazy { CarrierBasedSatelliteViewModelImpl(subscriptionId, iconInteractor) CarrierBasedSatelliteViewModelImpl( subscriptionId, airplaneModeInteractor, iconInteractor, scope, ) } /** Loading Loading @@ -145,9 +150,15 @@ class MobileIconViewModel( /** Representation of this network when it is non-terrestrial (e.g., satellite) */ private class CarrierBasedSatelliteViewModelImpl( override val subscriptionId: Int, airplaneModeInteractor: AirplaneModeInteractor, interactor: MobileIconInteractor, scope: CoroutineScope, ) : MobileIconViewModelCommon { override val isVisible: StateFlow<Boolean> = MutableStateFlow(true) override val isVisible: StateFlow<Boolean> = airplaneModeInteractor.isAirplaneMode .map { !it } .stateIn(scope, SharingStarted.WhileSubscribed(), false) override val icon: Flow<SignalIconModel> = interactor.signalLevelIcon override val contentDescription: Flow<MobileContentDescription?> = MutableStateFlow(null) Loading