Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt +3 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.mapNotNull Loading Loading @@ -181,6 +182,7 @@ class MobileConnectionRepositoryImpl( telephonyManager.registerTelephonyCallback(bgDispatcher.asExecutor(), callback) awaitClose { telephonyManager.unregisterTelephonyCallback(callback) } } .flowOn(bgDispatcher) .scan(initial = initial) { state, event -> state.applyEvent(event) } .stateIn(scope = scope, started = SharingStarted.WhileSubscribed(), initial) } Loading Loading @@ -358,6 +360,7 @@ class MobileConnectionRepositoryImpl( awaitClose { context.unregisterReceiver(receiver) } } .flowOn(bgDispatcher) .stateIn(scope, SharingStarted.WhileSubscribed(), defaultNetworkName) override val dataEnabled = run { Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt +17 −14 Original line number Diff line number Diff line Loading @@ -134,7 +134,8 @@ constructor( ) .stateIn(scope, started = SharingStarted.WhileSubscribed(), null) private val mobileSubscriptionsChangeEvent: Flow<Unit> = conflatedCallbackFlow { private val mobileSubscriptionsChangeEvent: Flow<Unit> = conflatedCallbackFlow { val callback = object : SubscriptionManager.OnSubscriptionsChangedListener() { override fun onSubscriptionsChanged() { Loading @@ -150,6 +151,7 @@ constructor( awaitClose { subscriptionManager.removeOnSubscriptionsChangedListener(callback) } } .flowOn(bgDispatcher) /** * State flow that emits the set of mobile data subscriptions, each represented by its own Loading Loading @@ -184,6 +186,7 @@ constructor( telephonyManager.registerTelephonyCallback(bgDispatcher.asExecutor(), callback) awaitClose { telephonyManager.unregisterTelephonyCallback(callback) } } .flowOn(bgDispatcher) .distinctUntilChanged() .logDiffsForTable( tableLogger, Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt +3 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.mapNotNull Loading Loading @@ -181,6 +182,7 @@ class MobileConnectionRepositoryImpl( telephonyManager.registerTelephonyCallback(bgDispatcher.asExecutor(), callback) awaitClose { telephonyManager.unregisterTelephonyCallback(callback) } } .flowOn(bgDispatcher) .scan(initial = initial) { state, event -> state.applyEvent(event) } .stateIn(scope = scope, started = SharingStarted.WhileSubscribed(), initial) } Loading Loading @@ -358,6 +360,7 @@ class MobileConnectionRepositoryImpl( awaitClose { context.unregisterReceiver(receiver) } } .flowOn(bgDispatcher) .stateIn(scope, SharingStarted.WhileSubscribed(), defaultNetworkName) override val dataEnabled = run { Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt +17 −14 Original line number Diff line number Diff line Loading @@ -134,7 +134,8 @@ constructor( ) .stateIn(scope, started = SharingStarted.WhileSubscribed(), null) private val mobileSubscriptionsChangeEvent: Flow<Unit> = conflatedCallbackFlow { private val mobileSubscriptionsChangeEvent: Flow<Unit> = conflatedCallbackFlow { val callback = object : SubscriptionManager.OnSubscriptionsChangedListener() { override fun onSubscriptionsChanged() { Loading @@ -150,6 +151,7 @@ constructor( awaitClose { subscriptionManager.removeOnSubscriptionsChangedListener(callback) } } .flowOn(bgDispatcher) /** * State flow that emits the set of mobile data subscriptions, each represented by its own Loading Loading @@ -184,6 +186,7 @@ constructor( telephonyManager.registerTelephonyCallback(bgDispatcher.asExecutor(), callback) awaitClose { telephonyManager.unregisterTelephonyCallback(callback) } } .flowOn(bgDispatcher) .distinctUntilChanged() .logDiffsForTable( tableLogger, Loading