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

Commit a8d1105b authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "If nothing to animate, don't call remote animator"

parents bef8a1be 93f9fe34
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -88,6 +88,10 @@ class RemoteAnimationController {
     * Called when the transition is ready to be started, and all leashes have been set up.
     */
    void goodToGo() {
        if (mPendingAnimations.isEmpty()) {
            onAnimationFinished();
            return;
        }
        mHandler.postDelayed(mTimeoutRunnable, TIMEOUT_MS);
        try {
            mRemoteAnimationAdapter.getRunner().onAnimationStart(createAnimations(),
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;

import android.graphics.Point;
import android.graphics.Rect;
@@ -134,4 +135,10 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
        verify(mMockRunner).onAnimationCancelled();
        verify(mFinishedCallback).onAnimationFinished(eq(adapter));
    }

    @Test
    public void testZeroAnimations() throws Exception {
        mController.goodToGo();
        verifyZeroInteractions(mMockRunner);
    }
}