Fixing issue with regression with launching focused task.
- Only update the focused task as you scroll if we are in touch
exploration mode.
- Use stack's notion of focused task as the currently focused task may
not have a TaskView and can be scrolled offscreen.
Bug: 25590404
Change-Id: I5ef1b66ec74aa1a3131993ed84905210f1e45f18
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 8729aa0..af30268 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -198,17 +198,12 @@
public boolean launchFocusedTask() {
if (mTaskStackView != null) {
TaskStack stack = mTaskStackView.getStack();
- // Iterate the stack views and try and find the focused task
- List<TaskView> taskViews = mTaskStackView.getTaskViews();
- int taskViewCount = taskViews.size();
- for (int j = 0; j < taskViewCount; j++) {
- TaskView tv = taskViews.get(j);
- Task task = tv.getTask();
- if (tv.isFocusedTask()) {
- onTaskViewClicked(mTaskStackView, tv, stack, task, false, false, null,
- INVALID_STACK_ID);
- return true;
- }
+ Task task = mTaskStackView.getFocusedTask();
+ if (task != null) {
+ TaskView taskView = mTaskStackView.getChildViewForTask(task);
+ onTaskViewClicked(mTaskStackView, taskView, stack, task, false, false, null,
+ INVALID_STACK_ID);
+ return true;
}
}
return false;