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

Commit 8031ce96 authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Fix transitions to/from DREAMING with keyguard_wm_state_refactor.

DeviceEntryInteractor previously worked without flexiglass enabled, but no longer does.

Also, filter keyguard state to suppress unwanted log noise from keyguard transitions complaining about invalid states.

Bug: 278086361
Test: atest DreamManagerServiceTests
Flag: com.android.systemui.keyguard_wm_state_refactor
Change-Id: I5c90901c6f7e24deddc6b2518c7ff5bb34a36bdb
parent b1c2ecde
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.filter

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

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