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

Commit 6c632855 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 a8cc1986 fc54ceaa
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.shade.domain.interactor

import com.android.keyguard.LockIconViewController
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.model.Scenes
@@ -30,7 +31,8 @@ import kotlinx.coroutines.launch
class ShadeLockscreenInteractorImpl
@Inject
constructor(
    @Background private val scope: CoroutineScope,
    @Application private val applicationScope: CoroutineScope,
    @Background private val backgroundScope: CoroutineScope,
    private val shadeInteractor: ShadeInteractor,
    private val sceneInteractor: SceneInteractor,
    private val lockIconViewController: LockIconViewController,
@@ -68,7 +70,7 @@ constructor(
        // Now handled elsewhere. Do nothing.
    }
    override fun transitionToExpandedShade(delay: Long) {
        scope.launch {
        backgroundScope.launch {
            delay(delay)
            changeToShadeScene()
        }
@@ -96,6 +98,7 @@ constructor(
    }

    private fun changeToShadeScene() {
        applicationScope.launch {
            val shadeMode = shadeInteractor.shadeMode.value
            sceneInteractor.changeScene(
                if (shadeMode is ShadeMode.Dual) Scenes.NotificationsShade else Scenes.Shade,
@@ -103,3 +106,4 @@ constructor(
            )
        }
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.systemui.shade.domain.interactor

import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.util.mockito.mock
@@ -25,7 +25,8 @@ import com.android.systemui.util.mockito.mock
val Kosmos.shadeLockscreenInteractor by
    Kosmos.Fixture {
        ShadeLockscreenInteractorImpl(
            scope = testScope,
            applicationScope = applicationCoroutineScope,
            backgroundScope = applicationCoroutineScope,
            shadeInteractor = shadeInteractorImpl,
            sceneInteractor = sceneInteractor,
            lockIconViewController = mock(),