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

Commit 52a1b489 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Fix shade showing over dream with bouncer" into main

parents cb1dad03 fc0de957
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.systemui.keyguard.shared.model.DozeStateModel
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.util.kotlin.Utils.Companion.sample as sampleCombine
import com.android.systemui.util.kotlin.sample
import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.seconds
@@ -71,6 +72,7 @@ constructor(
        listenForDreamingToAodOrDozing()
        listenForTransitionToCamera(scope, keyguardInteractor)
        listenForDreamingToGlanceableHub()
        listenForDreamingToPrimaryBouncer()
    }

    private fun listenForDreamingToGlanceableHub() {
@@ -84,6 +86,21 @@ constructor(
        }
    }

    private fun listenForDreamingToPrimaryBouncer() {
        scope.launch {
            keyguardInteractor.primaryBouncerShowing
                .sample(startedKeyguardTransitionStep, ::Pair)
                .collect { pair ->
                    val (isBouncerShowing, lastStartedTransitionStep) = pair
                    if (
                        isBouncerShowing && lastStartedTransitionStep.to == KeyguardState.DREAMING
                    ) {
                        startTransitionTo(KeyguardState.PRIMARY_BOUNCER)
                    }
                }
        }
    }

    fun startToLockscreenTransition() {
        scope.launch {
            KeyguardWmStateRefactor.isUnexpectedlyInLegacyMode()
+9 −6
Original line number Diff line number Diff line
@@ -384,6 +384,8 @@ public class NotificationShadeWindowViewController implements Dumpable {
                    float x = ev.getRawX();
                    float y = ev.getRawY();
                    if (mStatusBarViewController.touchIsWithinView(x, y)) {
                        if (!(MigrateClocksToBlueprint.isEnabled()
                                && mPrimaryBouncerInteractor.isBouncerShowing())) {
                            if (mStatusBarWindowStateController.windowIsShowing()) {
                                mIsTrackingBarGesture = true;
                                return logDownDispatch(ev, "sending touch to status bar",
@@ -392,6 +394,7 @@ public class NotificationShadeWindowViewController implements Dumpable {
                                return logDownDispatch(ev, "hidden or hiding", true);
                            }
                        }
                    }
                } else if (mIsTrackingBarGesture) {
                    final boolean sendToStatusBar = mStatusBarViewController.sendTouchToView(ev);
                    if (isUp || isCancel) {
+3 −1
Original line number Diff line number Diff line
@@ -1296,9 +1296,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
            return;
        }

        boolean hideBouncerOverDream = isBouncerShowing()
                && mDreamOverlayStateController.isOverlayActive();
        mCentralSurfaces.endAffordanceLaunch();
        // The second condition is for SIM card locked bouncer
        if (primaryBouncerIsScrimmed() && !needsFullscreenBouncer()) {
        if (hideBouncerOverDream || (primaryBouncerIsScrimmed() && !needsFullscreenBouncer())) {
            hideBouncer(false);
            updateStates();
        } else {
+24 −0
Original line number Diff line number Diff line
@@ -1388,6 +1388,30 @@ class KeyguardTransitionScenariosTest : SysuiTestCase() {
            coroutineContext.cancelChildren()
        }

    @Test
    fun dreamingToPrimaryBouncer() =
        testScope.runTest {
            // GIVEN a prior transition has run to DREAMING
            keyguardRepository.setDreaming(true)
            runTransitionAndSetWakefulness(KeyguardState.LOCKSCREEN, KeyguardState.DREAMING)
            runCurrent()

            // WHEN the primary bouncer is set to show
            bouncerRepository.setPrimaryShow(true)
            runCurrent()

            // THEN a transition to PRIMARY_BOUNCER should occur
            assertThat(transitionRepository)
                .startedTransition(
                    ownerName = "FromDreamingTransitionInteractor",
                    from = KeyguardState.DREAMING,
                    to = KeyguardState.PRIMARY_BOUNCER,
                    animatorAssertion = { it.isNotNull() },
                )

            coroutineContext.cancelChildren()
        }

    @Test
    fun dreamingToAod() =
        testScope.runTest {