Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt +3 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ interface MobileConnectionRepository { /** The carrierId for this connection. See [TelephonyManager.getSimCarrierId] */ val carrierId: StateFlow<Int> /** Reflects the value from the carrier config INFLATE_SIGNAL_STRENGTH for this connection */ val inflateSignalStrength: StateFlow<Boolean> /** * The table log buffer created for this connection. Will have the name "MobileConnectionLog * [subId]" Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt +23 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import com.android.systemui.statusbar.pipeline.wifi.data.repository.demo.model.F import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn /** Loading @@ -67,6 +68,17 @@ class DemoMobileConnectionRepository( ) .stateIn(scope, SharingStarted.WhileSubscribed(), _carrierId.value) private val _inflateSignalStrength: MutableStateFlow<Boolean> = MutableStateFlow(false) override val inflateSignalStrength = _inflateSignalStrength .logDiffsForTable( tableLogBuffer, columnPrefix = "", columnName = "inflate", _inflateSignalStrength.value ) .stateIn(scope, SharingStarted.WhileSubscribed(), _inflateSignalStrength.value) private val _isEmergencyOnly = MutableStateFlow(false) override val isEmergencyOnly = _isEmergencyOnly Loading Loading @@ -191,7 +203,16 @@ class DemoMobileConnectionRepository( .logDiffsForTable(tableLogBuffer, columnPrefix = "", _resolvedNetworkType.value) .stateIn(scope, SharingStarted.WhileSubscribed(), _resolvedNetworkType.value) override val numberOfLevels = MutableStateFlow(MobileConnectionRepository.DEFAULT_NUM_LEVELS) override val numberOfLevels = _inflateSignalStrength .map { shouldInflate -> if (shouldInflate) { DEFAULT_NUM_LEVELS + 1 } else { DEFAULT_NUM_LEVELS } } .stateIn(scope, SharingStarted.WhileSubscribed(), DEFAULT_NUM_LEVELS) override val dataEnabled = MutableStateFlow(true) Loading Loading @@ -226,8 +247,7 @@ class DemoMobileConnectionRepository( _carrierId.value = event.carrierId ?: INVALID_SUBSCRIPTION_ID numberOfLevels.value = if (event.inflateStrength) DEFAULT_NUM_LEVELS + 1 else DEFAULT_NUM_LEVELS _inflateSignalStrength.value = event.inflateStrength cdmaRoaming.value = event.roaming _isRoaming.value = event.roaming Loading Loading @@ -258,7 +278,6 @@ class DemoMobileConnectionRepository( carrierName.value = NetworkNameModel.SubscriptionDerived(CARRIER_MERGED_NAME) // TODO(b/276943904): is carrierId a thing with carrier merged networks? _carrierId.value = INVALID_SUBSCRIPTION_ID numberOfLevels.value = event.numberOfLevels cdmaRoaming.value = false _primaryLevel.value = event.level _cdmaLevel.value = event.level Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ class CarrierMergedConnectionRepository( override val isRoaming = MutableStateFlow(false).asStateFlow() override val carrierId = MutableStateFlow(INVALID_SUBSCRIPTION_ID).asStateFlow() override val inflateSignalStrength = MutableStateFlow(false).asStateFlow() override val isEmergencyOnly = MutableStateFlow(false).asStateFlow() override val operatorAlphaShort = MutableStateFlow(null).asStateFlow() override val isInService = MutableStateFlow(true).asStateFlow() Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt +15 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,21 @@ class FullMobileConnectionRepository( ) .stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.dataEnabled.value) override val inflateSignalStrength = activeRepo .flatMapLatest { it.inflateSignalStrength } .logDiffsForTable( tableLogBuffer, columnPrefix = "", columnName = "inflate", initialValue = activeRepo.value.inflateSignalStrength.value, ) .stateIn( scope, SharingStarted.WhileSubscribed(), activeRepo.value.inflateSignalStrength.value ) override val numberOfLevels = activeRepo .flatMapLatest { it.numberOfLevels } Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt +3 −1 Original line number Diff line number Diff line Loading @@ -302,8 +302,10 @@ class MobileConnectionRepositoryImpl( } .stateIn(scope, SharingStarted.WhileSubscribed(), UnknownNetworkType) override val inflateSignalStrength = systemUiCarrierConfig.shouldInflateSignalStrength override val numberOfLevels = systemUiCarrierConfig.shouldInflateSignalStrength inflateSignalStrength .map { shouldInflate -> if (shouldInflate) { DEFAULT_NUM_LEVELS + 1 Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt +3 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ interface MobileConnectionRepository { /** The carrierId for this connection. See [TelephonyManager.getSimCarrierId] */ val carrierId: StateFlow<Int> /** Reflects the value from the carrier config INFLATE_SIGNAL_STRENGTH for this connection */ val inflateSignalStrength: StateFlow<Boolean> /** * The table log buffer created for this connection. Will have the name "MobileConnectionLog * [subId]" Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt +23 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import com.android.systemui.statusbar.pipeline.wifi.data.repository.demo.model.F import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn /** Loading @@ -67,6 +68,17 @@ class DemoMobileConnectionRepository( ) .stateIn(scope, SharingStarted.WhileSubscribed(), _carrierId.value) private val _inflateSignalStrength: MutableStateFlow<Boolean> = MutableStateFlow(false) override val inflateSignalStrength = _inflateSignalStrength .logDiffsForTable( tableLogBuffer, columnPrefix = "", columnName = "inflate", _inflateSignalStrength.value ) .stateIn(scope, SharingStarted.WhileSubscribed(), _inflateSignalStrength.value) private val _isEmergencyOnly = MutableStateFlow(false) override val isEmergencyOnly = _isEmergencyOnly Loading Loading @@ -191,7 +203,16 @@ class DemoMobileConnectionRepository( .logDiffsForTable(tableLogBuffer, columnPrefix = "", _resolvedNetworkType.value) .stateIn(scope, SharingStarted.WhileSubscribed(), _resolvedNetworkType.value) override val numberOfLevels = MutableStateFlow(MobileConnectionRepository.DEFAULT_NUM_LEVELS) override val numberOfLevels = _inflateSignalStrength .map { shouldInflate -> if (shouldInflate) { DEFAULT_NUM_LEVELS + 1 } else { DEFAULT_NUM_LEVELS } } .stateIn(scope, SharingStarted.WhileSubscribed(), DEFAULT_NUM_LEVELS) override val dataEnabled = MutableStateFlow(true) Loading Loading @@ -226,8 +247,7 @@ class DemoMobileConnectionRepository( _carrierId.value = event.carrierId ?: INVALID_SUBSCRIPTION_ID numberOfLevels.value = if (event.inflateStrength) DEFAULT_NUM_LEVELS + 1 else DEFAULT_NUM_LEVELS _inflateSignalStrength.value = event.inflateStrength cdmaRoaming.value = event.roaming _isRoaming.value = event.roaming Loading Loading @@ -258,7 +278,6 @@ class DemoMobileConnectionRepository( carrierName.value = NetworkNameModel.SubscriptionDerived(CARRIER_MERGED_NAME) // TODO(b/276943904): is carrierId a thing with carrier merged networks? _carrierId.value = INVALID_SUBSCRIPTION_ID numberOfLevels.value = event.numberOfLevels cdmaRoaming.value = false _primaryLevel.value = event.level _cdmaLevel.value = event.level Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt +1 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ class CarrierMergedConnectionRepository( override val isRoaming = MutableStateFlow(false).asStateFlow() override val carrierId = MutableStateFlow(INVALID_SUBSCRIPTION_ID).asStateFlow() override val inflateSignalStrength = MutableStateFlow(false).asStateFlow() override val isEmergencyOnly = MutableStateFlow(false).asStateFlow() override val operatorAlphaShort = MutableStateFlow(null).asStateFlow() override val isInService = MutableStateFlow(true).asStateFlow() Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt +15 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,21 @@ class FullMobileConnectionRepository( ) .stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.dataEnabled.value) override val inflateSignalStrength = activeRepo .flatMapLatest { it.inflateSignalStrength } .logDiffsForTable( tableLogBuffer, columnPrefix = "", columnName = "inflate", initialValue = activeRepo.value.inflateSignalStrength.value, ) .stateIn( scope, SharingStarted.WhileSubscribed(), activeRepo.value.inflateSignalStrength.value ) override val numberOfLevels = activeRepo .flatMapLatest { it.numberOfLevels } Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt +3 −1 Original line number Diff line number Diff line Loading @@ -302,8 +302,10 @@ class MobileConnectionRepositoryImpl( } .stateIn(scope, SharingStarted.WhileSubscribed(), UnknownNetworkType) override val inflateSignalStrength = systemUiCarrierConfig.shouldInflateSignalStrength override val numberOfLevels = systemUiCarrierConfig.shouldInflateSignalStrength inflateSignalStrength .map { shouldInflate -> if (shouldInflate) { DEFAULT_NUM_LEVELS + 1 Loading