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

Commit 18172cce authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Show/hide keyguard views whenever we tell WM lockscreen is visible.

This fixes issues with cancellation, where we were waiting
until the transition FINISHED to re-show keyguard views.
But hey, at least it was settling on the correct state
even prior to this fix!

Fixes: 300674764
Test: cancel GONE -> AOD transition inflight
Change-Id: I4b6c13c38002c6c0e2b8c221f6b4e4127bd67867
parent 3c9c6205
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import static com.android.systemui.plugins.ActivityStarter.OnDismissAction;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING;
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
import static com.android.systemui.util.kotlin.JavaAdapterKt.combineFlows;

import android.content.Context;
import android.content.res.ColorStateList;
@@ -472,17 +471,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        }

        if (mFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) {
            // Show the keyguard views whenever we've told WM that the lockscreen is visible.
            mShadeViewController.postToView(() ->
                    collectFlow(
                        getViewRootImpl().getView(),
                        combineFlows(
                                mKeyguardTransitionInteractor.getFinishedKeyguardState(),
                                mWmLockscreenVisibilityInteractor.get()
                                        .getUsingKeyguardGoingAwayAnimation(),
                                (finishedState, animating) ->
                                        KeyguardInteractor.Companion.isKeyguardVisibleInState(
                                                finishedState)
                                                || animating),
                        mWmLockscreenVisibilityInteractor.get().getLockscreenVisibility(),
                        this::consumeShowStatusBarKeyguardView));
        }
    }