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

Commit 86652dee authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Hide status bar if keyguard is visible.

The legacy isHomeStatusBarAllowed flow doesn't cover edge cases like canceled swipe to dismiss transitions, and we don't have enough information in the KeyguardTransitionFramework to determine whether we're in a swipe/canceled swipe.

keyguard_wm_state_refactor and/or flexiglass do have this information, so this is a temporary fix.

Fixes: 407865650
Test: swipe to unlock partially
Test: cancel a swipe to unlock
Flag: EXEMPT bugfix
Change-Id: I2ea4c7ac9fc2042d55f305dc4f89322f53820e21
parent 3e67ccaf
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch

/**
 * A view model that manages the visibility of the [CollapsedStatusBarFragment] based on the device
@@ -445,7 +446,12 @@ constructor(
                keyguardInteractor.isSecureCameraActive,
                headsUpNotificationInteractor.statusBarHeadsUpStatus,
                isTransitioningFromGoneToDream,
            ) { isHomeStatusBarAllowed, isSecureCameraActive, headsUpState, isGoneToDream ->
                keyguardInteractor.isKeyguardVisible,
            ) { isHomeStatusBarAllowed,
                isSecureCameraActive,
                headsUpState,
                isGoneToDream,
                isKeyguardVisible ->
                val showForHeadsUp =
                    if (StatusBarNoHunBehavior.isEnabled) {
                        false
@@ -465,7 +471,12 @@ constructor(
                // momentarily visible because the dream animation has finished, but SysUI has not
                // been informed that the dream is full-screen. See b/273314977.
                showForHeadsUp ||
                    (isHomeStatusBarAllowed && !isSecureCameraActive && !isGoneToDream)
                    (isHomeStatusBarAllowed &&
                        !isSecureCameraActive &&
                        !isGoneToDream &&
                        // In legacy code, check if keyguard is visible to cover canceled
                        // transitions. In Flexi, the scene state is enough to cover this case.
                        if (!SceneContainerFlag.isEnabled) !isKeyguardVisible else true)
            }
            .distinctUntilChanged()
            .logDiffsForTable(