Merge "Don't focus view for invalid task index." into mnc-dev

This commit is contained in:
Winson Chung
2015-06-01 23:07:36 +00:00
committed by Android (Google) Code Review

View File

@@ -880,8 +880,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
// Start the focus animation when alt-tabbing
if (mConfig.launchedWithAltTab && !mConfig.launchedHasConfigurationChanged) {
TaskView tv = getChildViewForTask(mStack.getTasks().get(mFocusedTaskIndex));
ArrayList<Task> tasks = mStack.getTasks();
if (mConfig.launchedWithAltTab && !mConfig.launchedHasConfigurationChanged &&
0 <= mFocusedTaskIndex && mFocusedTaskIndex < tasks.size()) {
TaskView tv = getChildViewForTask(tasks.get(mFocusedTaskIndex));
if (tv != null) {
tv.setFocusedTask(true);
}