Fix anim done callback not being called sometimes

We should call dispatchFinishedWhenDone in endAnimations instead of
calling dispatchAnimationsFinished as the former will run the listener.
However, we only do this if we were running animations in the first
place.

Bug: 132285006
Test: Build and manual test endAnimations() call
Change-Id: I31afdc4c9e3ef5f56eda6178569d5c264c16ae78
diff --git a/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java b/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java
index 87ae695..9b4ab8e 100644
--- a/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java
+++ b/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java
@@ -235,6 +235,9 @@
 
     @Override
     public void endAnimations() {
+        if (!isRunning()) {
+            return;
+        }
         for (int i = mPendingAnims.size() - 1; i >= 0; i--) {
             PendingAnimation pendAnim = mPendingAnims.get(i);
             ViewHolder item = pendAnim.viewHolder;
@@ -254,7 +257,7 @@
             ObjectAnimator anim = mRunningAnims.get(i);
             anim.end();
         }
-        dispatchAnimationsFinished();
+        dispatchFinishedWhenDone();
     }
 
     @Override