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

Commit b39dded2 authored by 0's avatar 0
Browse files

[flexiglass] use LSToGoneTransitionViewModel for keyguardAlpha during LS -> GONE

With flexiglass on, using the shade/QS alpha for keyguard when on Gone scene was causing the stack to flicker when going from LS -> Gone scene, as well as during the first shade invocation after going from LS -> Gone. This CL switches us over to the alpha provided by LockscreenToGoneTransitionViewModel and only uses shade/QS alpha when shade/QS are actually occluding keyguard.

Bug: 364887368
Test: Manually verified keyguard alpha during LS -> Gone transition
Flag: com.android.systemui.scene_container
Change-Id: I837156b5e39cfc512ec7564824683a5acb6fc98b
parent 5bc4afb9
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -475,19 +475,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
            }