Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afa20f3a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make tileScope background" into main

parents ab988ebe 8b2183b8
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -17,18 +17,17 @@
package com.android.systemui.qs.tiles.base.viewmodel
package com.android.systemui.qs.tiles.base.viewmodel


import com.android.systemui.coroutines.newTracingContext
import com.android.systemui.coroutines.newTracingContext
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import javax.inject.Inject
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.SupervisorJob


/** Creates a [CoroutineScope] for the [QSTileViewModelImpl]. */
/** Creates a [CoroutineScope] for the [QSTileViewModelImpl]. */
class QSTileCoroutineScopeFactory
class QSTileCoroutineScopeFactory
@Inject
@Inject
constructor(@Application private val applicationScope: CoroutineScope) {
constructor(@Background private val bgDispatcher: CoroutineDispatcher) {


    fun create(): CoroutineScope =
    fun create(): CoroutineScope =
        CoroutineScope(
        CoroutineScope(bgDispatcher + SupervisorJob() + newTracingContext("QSTileScope"))
            applicationScope.coroutineContext + SupervisorJob() + newTracingContext("QSTileScope")
        )
}
}