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

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

Merge "Fix transitions to/from DREAMING with keyguard_wm_state_refactor." into main

parents b098d3a3 8031ce96
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -49,7 +49,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.filter


@OptIn(ExperimentalCoroutinesApi::class)
@OptIn(ExperimentalCoroutinesApi::class)
@SysUISingleton
@SysUISingleton
@@ -226,8 +225,15 @@ constructor(


        scope.launch {
        scope.launch {
            keyguardInteractor.isAbleToDream
            keyguardInteractor.isAbleToDream
                .filter { !it }
                .filterRelevantKeyguardStateAnd { !it }
                .sample(deviceEntryInteractor.isUnlocked, ::Pair)
                .sample(
                    if (SceneContainerFlag.isEnabled) {
                        deviceEntryInteractor.isUnlocked
                    } else {
                        keyguardInteractor.isKeyguardDismissible
                    },
                    ::Pair,
                )
                .collect { (_, dismissable) ->
                .collect { (_, dismissable) ->
                    // TODO(b/349837588): Add check for -> OCCLUDED.
                    // TODO(b/349837588): Add check for -> OCCLUDED.
                    if (dismissable) {
                    if (dismissable) {
+5 −1
Original line number Original line Diff line number Diff line
@@ -276,7 +276,11 @@ constructor(
                    false
                    false
                } else if (
                } else if (
                    currentState == KeyguardState.DREAMING &&
                    currentState == KeyguardState.DREAMING &&
                        if (SceneContainerFlag.isEnabled) {
                            deviceEntryInteractor.get().isUnlocked.value
                            deviceEntryInteractor.get().isUnlocked.value
                        } else {
                            keyguardInteractor.isKeyguardDismissible.value
                        }
                ) {
                ) {
                    // Dreams dismiss keyguard and return to GONE if they can.
                    // Dreams dismiss keyguard and return to GONE if they can.
                    false
                    false