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

Commit 7481be3c authored by Shawn Lee's avatar Shawn Lee Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] use LSToGoneTransitionViewModel for keyguardAlpha during LS -> GONE" into main

parents 6e7b24e8 b39dded2
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -484,19 +484,28 @@ constructor(
    }

    fun keyguardAlpha(viewState: ViewStateAccessor, scope: CoroutineScope): Flow<Float> {
        // Transitions are not (yet) authoritative for NSSL; they still rely on StatusBarState to
        // help determine when the device has fully moved to GONE or OCCLUDED state. Once SHADE
        // state has been set, let shade alpha take over
        val isKeyguardNotVisible =
            combine(
        val isKeyguardOccluded =
            keyguardTransitionInteractor.transitionValue(OCCLUDED).map { it == 1f }

        val isKeyguardNotVisibleInState =
            if (SceneContainerFlag.isEnabled) {
                isKeyguardOccluded
            } else {
                anyOf(
                    keyguardTransitionInteractor.transitionValue(OCCLUDED).map { it == 1f },
                    isKeyguardOccluded,
                    keyguardTransitionInteractor
                        .transitionValue(scene = Scenes.Gone, stateWithoutSceneContainer = GONE)
                        .map { it == 1f },
                ),
                keyguardInteractor.statusBarState,
            ) { isKeyguardNotVisibleInState, statusBarState ->
                )
            }

        // Transitions are not (yet) authoritative for NSSL; they still rely on StatusBarState to
        // help determine when the device has fully moved to GONE or OCCLUDED state. Once SHADE
        // state has been set, let shade alpha take over
        val isKeyguardNotVisible =
            combine(isKeyguardNotVisibleInState, keyguardInteractor.statusBarState) {
                isKeyguardNotVisibleInState,
                statusBarState ->
                isKeyguardNotVisibleInState && statusBarState == SHADE
            }