Fixing index bounds exception when TaskViews are added while dismissing.

am: ffaf07fed0

Change-Id: Iaf42d020a561626040ca1c6a3bd75240c6146f40
This commit is contained in:
Winson
2016-09-22 22:45:38 +00:00
committed by android-build-merger

View File

@@ -634,6 +634,12 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
}
int taskIndex = mCurrentTasks.indexOf(task);
if (taskIndex == -1) {
// If a task was added to the stack view after the start of the dismiss gesture,
// just ignore it
continue;
}
TaskViewTransform fromTransform = mCurrentTaskTransforms.get(taskIndex);
TaskViewTransform toTransform = mFinalTaskTransforms.get(taskIndex);