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

Commit 225a2b20 authored by Matt Pietal's avatar Matt Pietal Committed by Automerger Merge Worker
Browse files

Merge "Fix light reveal state" into udc-qpr-dev am: c33c00a2

parents 8766fb64 c33c00a2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(

    // FrameCallback used to delay starting the light reveal animation until the next frame
    private val startLightRevealCallback = TraceUtils.namedRunnable("startLightReveal") {
        lightRevealAnimationPlaying = true
        lightRevealAnimator.start()
    }

@@ -268,7 +269,6 @@ class UnlockedScreenOffAnimationController @Inject constructor(
            decidedToAnimateGoingToSleep = true

            shouldAnimateInKeyguard = true
            lightRevealAnimationPlaying = true

            // Start the animation on the next frame. startAnimation() is called after
            // PhoneWindowManager makes a binder call to System UI on
@@ -283,7 +283,8 @@ class UnlockedScreenOffAnimationController @Inject constructor(
                // dispatched, a race condition could make it possible for this callback to be run
                // as the device is waking up. That results in the AOD UI being shown while we wake
                // up, with unpredictable consequences.
                if (!powerManager.isInteractive(Display.DEFAULT_DISPLAY)) {
                if (!powerManager.isInteractive(Display.DEFAULT_DISPLAY) &&
                        shouldAnimateInKeyguard) {
                    aodUiAnimationPlaying = true

                    // Show AOD. That'll cause the KeyguardVisibilityHelper to call
+16 −0
Original line number Diff line number Diff line
@@ -134,6 +134,22 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() {
        verify(shadeViewController, times(1)).showAodUi()
    }

    @Test
    fun testAodUiShowNotInvokedIfWakingUp() {
        `when`(dozeParameters.canControlUnlockedScreenOff()).thenReturn(true)
        `when`(powerManager.isInteractive).thenReturn(false)

        val callbackCaptor = ArgumentCaptor.forClass(Runnable::class.java)
        controller.startAnimation()
        controller.onStartedWakingUp()

        verify(handler).postDelayed(callbackCaptor.capture(), anyLong())

        callbackCaptor.value.run()

        verify(shadeViewController, never()).showAodUi()
    }

    /**
     * The AOD UI is shown during the screen off animation, after a delay to allow the light reveal
     * animation to start. If the device is woken up during the screen off, we should *never* do