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

Commit d24ced25 authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Fix isOccludedByApp to exclude when occluded by communal (a non-app).

This is how the existing flow works, was just an oversight.

Bug: 278086361
Test: atest OccludingAppDeviceEntryInteractorTest
Flag: com.android.systemui.keyguard_wm_state_refactor
Change-Id: I434b0d9bf91cccfef84597dd61a113c125d84eb6
parent cddf273f
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -70,7 +70,14 @@ constructor(
) {
    private val keyguardOccludedByApp: Flow<Boolean> =
        if (KeyguardWmStateRefactor.isEnabled) {
            keyguardTransitionInteractor.currentKeyguardState.map { it == KeyguardState.OCCLUDED }
            combine(
                    keyguardTransitionInteractor.currentKeyguardState,
                    communalSceneInteractor.isIdleOnCommunal,
                    ::Pair,
                )
                .map { (currentState, isIdleOnCommunal) ->
                    currentState == KeyguardState.OCCLUDED && !isIdleOnCommunal
                }
        } else {
            combine(
                    keyguardInteractor.isKeyguardOccluded,
@@ -120,7 +127,7 @@ constructor(
            // On fingerprint success when the screen is on and not dreaming, go to the home screen
            fingerprintUnlockSuccessEvents
                .sample(
                    combine(powerInteractor.isInteractive, keyguardInteractor.isDreaming, ::Pair),
                    combine(powerInteractor.isInteractive, keyguardInteractor.isDreaming, ::Pair)
                )
                .collect { (interactive, dreaming) ->
                    if (interactive && !dreaming) {
@@ -148,7 +155,7 @@ constructor(
                        }
                    },
                    /* cancel= */ null,
                    /* afterKeyguardGone */ false
                    /* afterKeyguardGone */ false,
                )
            }
        }