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

Commit f35e5307 authored by Josh Tsuji's avatar Josh Tsuji Committed by Android (Google) Code Review
Browse files

Merge "[keyguard_wm_state_refactor] Fix flickering on canceled screen off." into main

parents 786da74e 963b552a
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -304,12 +304,7 @@ class FromAodTransitionInteractorTest : SysuiTestCase() {
            powerInteractor.setAwakeForTest()
            runCurrent()

            // Waking up from wake and unlock should not start any transitions, we'll wait for the
            // dismiss call.
            assertThat(transitionRepository).noTransitionsStarted()

            underTest.dismissAod()
            advanceTimeBy(100) // account for debouncing

            assertThat(transitionRepository)
                .startedTransition(from = KeyguardState.AOD, to = KeyguardState.GONE)
@@ -327,12 +322,7 @@ class FromAodTransitionInteractorTest : SysuiTestCase() {
            powerInteractor.setAwakeForTest()
            runCurrent()

            // Waking up from wake and unlock should not start any transitions, we'll wait for the
            // dismiss call.
            assertThat(transitionRepository).noTransitionsStarted()

            underTest.dismissAod()
            advanceTimeBy(100) // account for debouncing

            assertThat(transitionRepository)
                .startedTransition(from = KeyguardState.AOD, to = KeyguardState.GONE)
+11 −4
Original line number Diff line number Diff line
@@ -93,7 +93,13 @@ constructor(
        // transition.
        scope.launch("$TAG#listenForAodToAwake") {
            powerInteractor.detailedWakefulness
                .debounce(50L)
                .apply {
                    if (!KeyguardWmStateRefactor.isEnabled) {
                        // This works around some timing issues pre-refactor that are no longer an
                        // issue (and this causes problems with the flag enabled).
                        debounce(50L)
                    }
                }
                .filterRelevantKeyguardStateAnd { wakefulness -> wakefulness.isAwake() }
                .sample(wakeToGoneInteractor.canWakeDirectlyToGone, ::Pair)
                .collect {
@@ -155,10 +161,11 @@ constructor(
                            )
                        } else if (shouldTransitionToLockscreen) {
                            val modeOnCanceled =
                                if (startedStep.from == KeyguardState.LOCKSCREEN) {
                                if (
                                    startedStep.from == KeyguardState.LOCKSCREEN ||
                                        startedStep.from == KeyguardState.GONE
                                ) {
                                    TransitionModeOnCanceled.REVERSE
                                } else if (startedStep.from == KeyguardState.GONE) {
                                    TransitionModeOnCanceled.RESET
                                } else {
                                    TransitionModeOnCanceled.LAST_VALUE
                                }