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

Commit be4ab51c authored by Sherry Zhou's avatar Sherry Zhou Committed by Android (Google) Code Review
Browse files

Revert "Fix clock staying in AOD state in LS when transitioning from bouncer and camera"

This reverts commit 8ab059aa.

Reason for revert: b/333610414

Change-Id: Ia60e23ccfaefd4c6955f3fd2776d127fd1bc49b3
parent 8ab059aa
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -432,7 +432,6 @@ constructor(
                    if (MigrateClocksToBlueprint.isEnabled) {
                        listenForDozeAmountTransition(this)
                        listenForAnyStateToAodTransition(this)
                        listenForAnyStateToLockscreenTransition(this)
                    } else {
                        listenForDozeAmount(this)
                    }
@@ -566,17 +565,6 @@ constructor(
        }
    }

    @VisibleForTesting
    internal fun listenForAnyStateToLockscreenTransition(scope: CoroutineScope): Job {
        return scope.launch("$TAG#listenForAnyStateToLockscreenTransition") {
            keyguardTransitionInteractor
                    .transitionStepsToState(LOCKSCREEN)
                    .filter { it.transitionState == TransitionState.STARTED }
                    .filter { it.from != AOD }
                    .collect { handleDoze(0f) }
        }
    }

    @VisibleForTesting
    internal fun listenForDozing(scope: CoroutineScope): Job {
        return scope.launch("$TAG#listenForDozing") {
+0 −42
Original line number Diff line number Diff line
@@ -361,27 +361,6 @@ class ClockEventControllerTest : SysuiTestCase() {
            job.cancel()
        }

    @Test
    fun listenForTransitionToLSFromOccluded_updatesClockDozeAmountToOne() =
        runBlocking(IMMEDIATE) {
            val transitionStep = MutableStateFlow(TransitionStep())
            whenever(keyguardTransitionInteractor.transitionStepsToState(KeyguardState.LOCKSCREEN))
                    .thenReturn(transitionStep)

            val job = underTest.listenForAnyStateToLockscreenTransition(this)
            transitionStep.value =
                    TransitionStep(
                            from = KeyguardState.OCCLUDED,
                            to = KeyguardState.LOCKSCREEN,
                            transitionState = TransitionState.STARTED,
                    )
            yield()

            verify(animations, times(2)).doze(0f)

            job.cancel()
        }

    @Test
    fun listenForTransitionToAodFromLockscreen_neverUpdatesClockDozeAmount() =
        runBlocking(IMMEDIATE) {
@@ -403,27 +382,6 @@ class ClockEventControllerTest : SysuiTestCase() {
            job.cancel()
        }

    @Test
    fun listenForAnyStateToLockscreenTransition_neverUpdatesClockDozeAmount() =
        runBlocking(IMMEDIATE) {
            val transitionStep = MutableStateFlow(TransitionStep())
            whenever(keyguardTransitionInteractor.transitionStepsToState(KeyguardState.LOCKSCREEN))
                    .thenReturn(transitionStep)

            val job = underTest.listenForAnyStateToLockscreenTransition(this)
            transitionStep.value =
                    TransitionStep(
                            from = KeyguardState.AOD,
                            to = KeyguardState.LOCKSCREEN,
                            transitionState = TransitionState.STARTED,
                    )
            yield()

            verify(animations, never()).doze(0f)

            job.cancel()
        }

    @Test
    fun unregisterListeners_validate() =
        runBlocking(IMMEDIATE) {