Fixing crash when cancelAnimaiton happens while we are aboutto enter long-swipe

Bug: 79419808
Change-Id: I17741ef7b35a8b82543e52c4958289933cf04a43
This commit is contained in:
Sunny Goyal 2018-05-10 12:01:01 -07:00
parent 5d1873a812
commit 1d82dd4d12
1 changed files with 7 additions and 0 deletions

View File

@ -880,6 +880,13 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
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();