Loading packages/SystemUI/utils/kairos/src/com/android/systemui/kairos/internal/Network.kt +4 −8 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ internal class Network( private val muxMovers = ArrayDeque<MuxDeferredNode<*, *, *>>() private val deactivations = ArrayDeque<PushNode<*>>() private val outputDeactivations = ArrayDeque<Output<*>>() private val inputScheduleChan = Channel<ScheduledAction<*>>() private val inputScheduleChan = Channel<ScheduledAction<*>>(Channel.UNLIMITED) override fun scheduleOutput(output: Output<*>) { fastOutputs.add(output) Loading Loading @@ -169,14 +169,10 @@ internal class Network( onResult.cancel() return@also } val job = coroutineScope.launch { inputScheduleChan.send( inputScheduleChan.trySend( ScheduledAction(reason, onStartTransaction = block, onResult = onResult) ) } onResult.invokeOnCompletion { job.cancel() } } inline fun <R> runThenDrainDeferrals(block: () -> R): R = block().also { deferScopeImpl.drainDeferrals() } Loading Loading
packages/SystemUI/utils/kairos/src/com/android/systemui/kairos/internal/Network.kt +4 −8 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ internal class Network( private val muxMovers = ArrayDeque<MuxDeferredNode<*, *, *>>() private val deactivations = ArrayDeque<PushNode<*>>() private val outputDeactivations = ArrayDeque<Output<*>>() private val inputScheduleChan = Channel<ScheduledAction<*>>() private val inputScheduleChan = Channel<ScheduledAction<*>>(Channel.UNLIMITED) override fun scheduleOutput(output: Output<*>) { fastOutputs.add(output) Loading Loading @@ -169,14 +169,10 @@ internal class Network( onResult.cancel() return@also } val job = coroutineScope.launch { inputScheduleChan.send( inputScheduleChan.trySend( ScheduledAction(reason, onStartTransaction = block, onResult = onResult) ) } onResult.invokeOnCompletion { job.cancel() } } inline fun <R> runThenDrainDeferrals(block: () -> R): R = block().also { deferScopeImpl.drainDeferrals() } Loading