From 436d5971b1b84e491f8e15ee9bbd8c2253e5f637 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 31 May 2019 10:21:28 -0700 Subject: [PATCH] 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 --- .../com/android/quickstep/WindowTransformSwipeHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0d0478ae05..030d0dd5c8 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.quickstep.views.TaskView; 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 @@ public class WindowTransformSwipeHandler } private void buildAnimationController() { + if (mStateCallback.hasStates(STATE_GESTURE_COMPLETED)) { + return; + } initTransitionEndpoints(mActivity.getDeviceProfile()); mAnimationFactory.createActivityController(mTransitionDragLength); }