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

Commit 646ad8b6 authored by Julia Tuttle's avatar Julia Tuttle Committed by Android (Google) Code Review
Browse files

Merge "ShadeLockscreenInteractor: change scene on main thread" into main

parents e47952d1 287d452d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -18,18 +18,22 @@ package com.android.systemui.shade.domain.interactor

import com.android.keyguard.LockIconViewController
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.model.SceneFamilies
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.data.repository.ShadeRepository
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class ShadeLockscreenInteractorImpl
@Inject
constructor(
    @Main private val mainDispatcher: CoroutineDispatcher,
    @Background private val backgroundScope: CoroutineScope,
    private val shadeInteractor: ShadeInteractor,
    private val sceneInteractor: SceneInteractor,
@@ -71,7 +75,7 @@ constructor(
    override fun transitionToExpandedShade(delay: Long) {
        backgroundScope.launch {
            delay(delay)
            changeToShadeScene()
            withContext(mainDispatcher) { changeToShadeScene() }
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.shade.domain.interactor

import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.util.mockito.mock
@@ -25,6 +26,7 @@ import com.android.systemui.util.mockito.mock
val Kosmos.shadeLockscreenInteractor by
    Kosmos.Fixture {
        ShadeLockscreenInteractorImpl(
            mainDispatcher = testDispatcher,
            backgroundScope = applicationCoroutineScope,
            shadeInteractor = shadeInteractorImpl,
            sceneInteractor = sceneInteractor,