From 1d82dd4d128da64989538358655e4288daf15018 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 10 May 2018 12:01:01 -0700 Subject: [PATCH] Fixing crash when cancelAnimaiton happens while we are aboutto enter long-swipe Bug: 79419808 Change-Id: I17741ef7b35a8b82543e52c4958289933cf04a43 --- .../com/android/quickstep/WindowTransformSwipeHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) 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();