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

Commit 253e46c1 authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[bc25] Update KeyguardDismissActionInteractor to account for overlays.

This expands the definition of `isOnShadeWhileUnlocked` to include the
shade when it's visible any amount, which is consistent with the compose
bouncer definition.

Bug: 356596436
Flag: com.android.systemui.scene_container
Flag: com.android.systemui.dual_shade
Test: Existing unit tests still pass.
Change-Id: Ia9d27e10bec428e69d4b8c2dba2f0c4aed6f0783
parent 7bd42135
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import com.android.systemui.power.shared.model.WakefulnessState
import com.android.systemui.scene.data.repository.Idle
import com.android.systemui.scene.data.repository.Transition
import com.android.systemui.scene.data.repository.setSceneTransition
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.testKosmos
@@ -76,7 +75,6 @@ class KeyguardDismissActionInteractorTest : SysuiTestCase() {
                transitionInteractor = kosmos.keyguardTransitionInteractor,
                dismissInteractor = dismissInteractor,
                applicationScope = testScope.backgroundScope,
                sceneInteractor = { kosmos.sceneInteractor },
                deviceUnlockedInteractor = { kosmos.deviceUnlockedInteractor },
                powerInteractor = kosmos.powerInteractor,
                alternateBouncerInteractor = kosmos.alternateBouncerInteractor,
+9 −11
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import com.android.systemui.keyguard.shared.model.KeyguardDone
import com.android.systemui.keyguard.shared.model.KeyguardState.GONE
import com.android.systemui.keyguard.shared.model.KeyguardState.PRIMARY_BOUNCER
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.domain.interactor.ShadeInteractor
@@ -60,7 +59,6 @@ constructor(
    transitionInteractor: KeyguardTransitionInteractor,
    val dismissInteractor: KeyguardDismissInteractor,
    @Application private val applicationScope: CoroutineScope,
    sceneInteractor: Lazy<SceneInteractor>,
    deviceUnlockedInteractor: Lazy<DeviceUnlockedInteractor>,
    powerInteractor: PowerInteractor,
    alternateBouncerInteractor: AlternateBouncerInteractor,
@@ -102,11 +100,10 @@ constructor(
    private val isOnShadeWhileUnlocked: Flow<Boolean> =
        if (SceneContainerFlag.isEnabled) {
            combine(
                    sceneInteractor.get().currentScene,
                    shadeInteractor.get().isAnyExpanded,
                    deviceUnlockedInteractor.get().deviceUnlockStatus,
                ) { scene, unlockStatus ->
                    unlockStatus.isUnlocked &&
                        (scene == Scenes.QuickSettings || scene == Scenes.Shade)
                ) { isAnyExpanded, unlockStatus ->
                    isAnyExpanded && unlockStatus.isUnlocked
                }
                .distinctUntilChanged()
        } else if (ComposeBouncerFlags.isOnlyComposeBouncerEnabled()) {
@@ -116,6 +113,7 @@ constructor(
                ) { isAnyExpanded, keyguardDismissible ->
                    isAnyExpanded && keyguardDismissible
                }
                .distinctUntilChanged()
        } else {
            flow {
                error(
+0 −2
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import com.android.systemui.keyguard.data.repository.keyguardRepository
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.shade.domain.interactor.shadeInteractor
import kotlinx.coroutines.ExperimentalCoroutinesApi

@@ -34,7 +33,6 @@ val Kosmos.keyguardDismissActionInteractor by
            transitionInteractor = keyguardTransitionInteractor,
            dismissInteractor = keyguardDismissInteractor,
            applicationScope = testScope.backgroundScope,
            sceneInteractor = { sceneInteractor },
            deviceUnlockedInteractor = { deviceUnlockedInteractor },
            powerInteractor = powerInteractor,
            alternateBouncerInteractor = alternateBouncerInteractor,