Loading packages/SystemUI/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileCoroutineScopeFactory.kt +4 −5 Original line number Original line Diff line number Diff line Loading @@ -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") ) } } Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileCoroutineScopeFactory.kt +4 −5 Original line number Original line Diff line number Diff line Loading @@ -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") ) } }