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

Commit ea745d42 authored by William Xiao's avatar William Xiao Committed by Android (Google) Code Review
Browse files

Merge "Don't set exit animation state in DreamOverlayAnimationsController.wakeUp" into main

parents 5362e4e2 aa93e6db
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -88,21 +88,14 @@ class DreamOverlayAnimationsControllerTest : SysuiTestCase() {
    }

    @Test
    fun testWakeUpSetsExitAnimationsRunning() {
        controller.wakeUp()

        verify(stateController).setExitAnimationsRunning(true)
    }

    @Test
    fun testWakeUpAfterStartWillCancel() {
    fun testOnWakeUpAfterStartWillCancel() {
        val mockStartAnimator: AnimatorSet = mock()

        controller.startEntryAnimations(false, animatorBuilder = { mockStartAnimator })

        verify(mockStartAnimator, never()).cancel()

        controller.wakeUp()
        controller.onWakeUp()

        // Verify that we cancelled the start animator in favor of the exit
        // animator.
+2 −2
Original line number Diff line number Diff line
@@ -664,14 +664,14 @@ class DreamOverlayServiceTest : SysuiTestCase() {
        )
        mMainExecutor.runAllReady()
        mService.onWakeUp()
        verify(mDreamOverlayContainerViewController).wakeUp()
        verify(mDreamOverlayContainerViewController).onWakeUp()
        verify(mDreamOverlayCallbackController).onWakeUp()
    }

    @Test
    fun testWakeUpBeforeStartDoesNothing() {
        mService.onWakeUp()
        verify(mDreamOverlayContainerViewController, Mockito.never()).wakeUp()
        verify(mDreamOverlayContainerViewController, Mockito.never()).onWakeUp()
    }

    @Test
+1 −3
Original line number Diff line number Diff line
@@ -255,10 +255,8 @@ constructor(
        return mAnimator as AnimatorSet
    }

    /** Starts the dream content and dream overlay exit animations. */
    fun wakeUp() {
    fun onWakeUp() {
        cancelAnimations()
        mOverlayStateController.setExitAnimationsRunning(true)
    }

    /** Cancels the dream content and dream overlay animations, if they're currently running. */
+4 −3
Original line number Diff line number Diff line
@@ -381,16 +381,17 @@ public class DreamOverlayContainerViewController extends
    }

    /**
     * Handle the dream waking up and run any necessary animations.
     * Handle the dream waking up.
     */
    public void wakeUp() {
    public void onWakeUp() {
        // TODO(b/361872929): clean up this bool as it doesn't do anything anymore
        // When swiping causes wakeup, do not run any animations as the dream should exit as soon
        // as possible.
        if (mWakingUpFromSwipe) {
            return;
        }

        mDreamOverlayAnimationsController.wakeUp();
        mDreamOverlayAnimationsController.onWakeUp();
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
    public void onWakeUp() {
        if (mDreamOverlayContainerViewController != null) {
            mDreamOverlayCallbackController.onWakeUp();
            mDreamOverlayContainerViewController.wakeUp();
            mDreamOverlayContainerViewController.onWakeUp();
        }
    }