Merge "Fixing crash when swiping away last task."

This commit is contained in:
Winson Chung
2015-10-30 23:17:29 +00:00
committed by Android (Google) Code Review

View File

@@ -1273,8 +1273,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
// the next task
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
setFocusedTask(taskIndex - 1,
!mStack.getTasks().get(taskIndex - 1).isFreeformTask() /* scrollToTask */,
boolean isFreeformTask = taskIndex > 0 ?
mStack.getTasks().get(taskIndex - 1).isFreeformTask() : false;
setFocusedTask(taskIndex - 1, !isFreeformTask /* scrollToTask */,
launchState.launchedWithAltTab);
}
}