Don't recreate the launcher animation controller if gesture ended

This can happen if we get onApplyWindowInsets() after onGestureEnded().
In that case, we can get into some bad states because the running
animation is overwritten and thus can't be canceled.

Bug: 134096917
Bug: 133806285
Change-Id: Ic517d68a46a4446ca382445df1ba62c26e8243ad
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 0d0478a..030d0dd 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -106,7 +106,6 @@
 import com.android.systemui.shared.recents.model.ThumbnailData;
 import com.android.systemui.shared.system.InputConsumerController;
 import com.android.systemui.shared.system.LatencyTrackerCompat;
-import com.android.systemui.shared.system.QuickStepContract;
 import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
 import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat;
 import com.android.systemui.shared.system.WindowCallbacksCompat;
@@ -647,6 +646,9 @@
     }
 
     private void buildAnimationController() {
+        if (mStateCallback.hasStates(STATE_GESTURE_COMPLETED)) {
+            return;
+        }
         initTransitionEndpoints(mActivity.getDeviceProfile());
         mAnimationFactory.createActivityController(mTransitionDragLength);
     }