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

Commit 81abce77 authored by Matt Pietal's avatar Matt Pietal
Browse files

Modify occluded for shade window take#2

Oops, use transitionValue instead. isFinishedIn will not
change until the next FINISHED state emits. Rather, we
only need to care about when the user is idle in this
state.

This will count GLANCEABLE_HUB as an occluded state,
and not change the value when transitioning between
occluded states.

Fixes: 359939084
Test: atest NotificationShadeWindowModelTest
Flag: com.android.systemui.use_transitions_for_keyguard_occluded
Change-Id: I49070394a75620ecbf3638674419c319e4e4eb48
parent f2767e98
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.util.kotlin.BooleanFlowOperators.any
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

/** Models UI state for the shade window. */
@SysUISingleton
@@ -42,9 +43,11 @@ constructor(
    val isKeyguardOccluded: Flow<Boolean> =
        listOf(
                // Finished in state...
                keyguardTransitionInteractor.isFinishedIn(OCCLUDED),
                keyguardTransitionInteractor.isFinishedIn(DREAMING),
                keyguardTransitionInteractor.isFinishedIn(Scenes.Communal, GLANCEABLE_HUB),
                keyguardTransitionInteractor.transitionValue(OCCLUDED).map { it == 1f },
                keyguardTransitionInteractor.transitionValue(DREAMING).map { it == 1f },
                keyguardTransitionInteractor.transitionValue(Scenes.Communal, GLANCEABLE_HUB).map {
                    it == 1f
                },

                // ... or transitions between those states
                keyguardTransitionInteractor.isInTransition(Edge.create(OCCLUDED, DREAMING)),