diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java index 2eae2aebef..57993a44e8 100644 --- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -880,6 +880,13 @@ public class WindowTransformSwipeHandler { return; } + RemoteAnimationTargetSet targetSet = mRecentsAnimationWrapper.targetSet; + if (targetSet == null) { + // This can happen when cancelAnimation comes on the background thread, while we are + // processing the long swipe on the UI thread. + return; + } + mLongSwipeController = mActivityControlHelper.getLongSwipeController( mActivity, mRecentsAnimationWrapper.targetSet); onLongSwipeDisplacementUpdated();