Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,11 @@ interface MobileConnectionRepository { /** The service provider name for this network connection, or the default name */ val networkName: StateFlow<NetworkNameModel> /** * True if this type of connection is allowed while airplane mode is on, and false otherwise. */ val isAllowedDuringAirplaneMode: StateFlow<Boolean> companion object { /** The default number of levels to use for [numberOfLevels]. */ const val DEFAULT_NUM_LEVELS = 4 Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,8 @@ class DemoMobileConnectionRepository( override val networkName = MutableStateFlow(NetworkNameModel.IntentDerived("demo network")) override val isAllowedDuringAirplaneMode = MutableStateFlow(false) /** * Process a new demo mobile event. Note that [resolvedNetworkType] must be passed in separately * from the event, due to the requirement to reverse the mobile mappings lookup in the top-level Loading Loading @@ -217,6 +219,8 @@ class DemoMobileConnectionRepository( (event.activity ?: TelephonyManager.DATA_ACTIVITY_NONE).toMobileDataActivityModel() _carrierNetworkChangeActive.value = event.carrierNetworkChange _resolvedNetworkType.value = resolvedNetworkType isAllowedDuringAirplaneMode.value = false } fun processCarrierMergedEvent(event: FakeWifiEventModel.CarrierMerged) { Loading @@ -240,6 +244,7 @@ class DemoMobileConnectionRepository( _isInService.value = true _isGsm.value = false _carrierNetworkChangeActive.value = false isAllowedDuringAirplaneMode.value = true } companion object { Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,13 @@ class CarrierMergedConnectionRepository( override val isGsm = MutableStateFlow(false).asStateFlow() override val carrierNetworkChangeActive = MutableStateFlow(false).asStateFlow() /** * Carrier merged connections happen over wifi but are displayed as a mobile triangle. Because * they occur over wifi, it's possible to have a valid carrier merged connection even during * airplane mode. See b/291993542. */ override val isAllowedDuringAirplaneMode = MutableStateFlow(true).asStateFlow() override val dataEnabled: StateFlow<Boolean> = wifiRepository.isWifiEnabled companion object { Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt +9 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,15 @@ class FullMobileConnectionRepository( ) .stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.networkName.value) override val isAllowedDuringAirplaneMode = activeRepo .flatMapLatest { it.isAllowedDuringAirplaneMode } .stateIn( scope, SharingStarted.WhileSubscribed(), activeRepo.value.isAllowedDuringAirplaneMode.value, ) class Factory @Inject constructor( Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt +5 −0 Original line number Diff line number Diff line Loading @@ -59,8 +59,10 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.asExecutor import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.map Loading Loading @@ -331,6 +333,9 @@ class MobileConnectionRepositoryImpl( .stateIn(scope, SharingStarted.WhileSubscribed(), initial) } /** Typical mobile connections aren't available during airplane mode. */ override val isAllowedDuringAirplaneMode = MutableStateFlow(false).asStateFlow() class Factory @Inject constructor( Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,11 @@ interface MobileConnectionRepository { /** The service provider name for this network connection, or the default name */ val networkName: StateFlow<NetworkNameModel> /** * True if this type of connection is allowed while airplane mode is on, and false otherwise. */ val isAllowedDuringAirplaneMode: StateFlow<Boolean> companion object { /** The default number of levels to use for [numberOfLevels]. */ const val DEFAULT_NUM_LEVELS = 4 Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,8 @@ class DemoMobileConnectionRepository( override val networkName = MutableStateFlow(NetworkNameModel.IntentDerived("demo network")) override val isAllowedDuringAirplaneMode = MutableStateFlow(false) /** * Process a new demo mobile event. Note that [resolvedNetworkType] must be passed in separately * from the event, due to the requirement to reverse the mobile mappings lookup in the top-level Loading Loading @@ -217,6 +219,8 @@ class DemoMobileConnectionRepository( (event.activity ?: TelephonyManager.DATA_ACTIVITY_NONE).toMobileDataActivityModel() _carrierNetworkChangeActive.value = event.carrierNetworkChange _resolvedNetworkType.value = resolvedNetworkType isAllowedDuringAirplaneMode.value = false } fun processCarrierMergedEvent(event: FakeWifiEventModel.CarrierMerged) { Loading @@ -240,6 +244,7 @@ class DemoMobileConnectionRepository( _isInService.value = true _isGsm.value = false _carrierNetworkChangeActive.value = false isAllowedDuringAirplaneMode.value = true } companion object { Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,13 @@ class CarrierMergedConnectionRepository( override val isGsm = MutableStateFlow(false).asStateFlow() override val carrierNetworkChangeActive = MutableStateFlow(false).asStateFlow() /** * Carrier merged connections happen over wifi but are displayed as a mobile triangle. Because * they occur over wifi, it's possible to have a valid carrier merged connection even during * airplane mode. See b/291993542. */ override val isAllowedDuringAirplaneMode = MutableStateFlow(true).asStateFlow() override val dataEnabled: StateFlow<Boolean> = wifiRepository.isWifiEnabled companion object { Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt +9 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,15 @@ class FullMobileConnectionRepository( ) .stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.networkName.value) override val isAllowedDuringAirplaneMode = activeRepo .flatMapLatest { it.isAllowedDuringAirplaneMode } .stateIn( scope, SharingStarted.WhileSubscribed(), activeRepo.value.isAllowedDuringAirplaneMode.value, ) class Factory @Inject constructor( Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt +5 −0 Original line number Diff line number Diff line Loading @@ -59,8 +59,10 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.asExecutor import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.map Loading Loading @@ -331,6 +333,9 @@ class MobileConnectionRepositoryImpl( .stateIn(scope, SharingStarted.WhileSubscribed(), initial) } /** Typical mobile connections aren't available during airplane mode. */ override val isAllowedDuringAirplaneMode = MutableStateFlow(false).asStateFlow() class Factory @Inject constructor( Loading