diff options
| author | 2016-03-07 14:52:59 -0800 | |
|---|---|---|
| committer | 2016-03-07 22:54:37 +0000 | |
| commit | 4333694d8a7024a141ffb12cd59b0b56a362baa5 (patch) | |
| tree | ef30a6e8ecfbd29e144c283116341e11a0ec322e | |
| parent | 4e7ad35b2f1e1a9bdcabfb56306dd162909932a8 (diff) | |
Fixing screenshot regression from ag/879131.
- We were not poking existing TaskViews from updating after their tasks
have been updated (ie. with a new screenshot)
Change-Id: I33916aecf004afdb88a2462e69437ad1d9e8017d
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 6abb82686c63..9da8fee137a6 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -307,7 +307,16 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // measure/layout pass updateLayoutAlgorithm(false /* boundScroll */, EMPTY_TASK_SET); updateToInitialState(); - relayoutTaskViewsOnNextFrame(AnimationProps.IMMEDIATE); + relayoutTaskViews(AnimationProps.IMMEDIATE); + + // Rebind all the task views. This will not trigger new resources to be loaded unless + // they have actually changed + List<TaskView> taskViews = getTaskViews(); + int taskViewCount = taskViews.size(); + for (int i = 0; i < taskViewCount; i++) { + TaskView tv = taskViews.get(i); + bindTaskView(tv, tv.getTask()); + } } } @@ -640,9 +649,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal List<TaskView> taskViews = getTaskViews(); int taskViewCount = taskViews.size(); for (int i = 0; i < taskViewCount; i++) { - final TaskView tv = taskViews.get(i); - final int taskIndex = mStack.indexOfStackTask(tv.getTask()); - final TaskViewTransform transform = mCurrentTaskTransforms.get(taskIndex); + TaskView tv = taskViews.get(i); + int taskIndex = mStack.indexOfStackTask(tv.getTask()); + TaskViewTransform transform = mCurrentTaskTransforms.get(taskIndex); if (ignoreTasksSet.contains(tv.getTask().key)) { continue; @@ -1430,8 +1439,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal public void onReturnViewToPool(TaskView tv) { final Task task = tv.getTask(); - // Report that this task's data is no longer being used - Recents.getTaskLoader().unloadTaskData(task); + // Unbind the task from the task view + unbindTaskView(tv, task); // Reset the view properties and view state tv.resetViewProperties(); @@ -1476,11 +1485,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Update the task views list after adding the new task view updateTaskViewsList(); - // Rebind the task and request that this task's data be filled into the TaskView - tv.onTaskBound(task); - - // Load the task data - Recents.getTaskLoader().loadTaskData(task, true /* fetchAndInvalidateThumbnails */); + // Bind the task view to the new task + bindTaskView(tv, task); // If the doze trigger has already fired, then update the state for this task view if (mUIDozeTrigger.isAsleep()) { @@ -1512,6 +1518,19 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal return (tv.getTask() == preferredData); } + private void bindTaskView(TaskView tv, Task task) { + // Rebind the task and request that this task's data be filled into the TaskView + tv.onTaskBound(task); + + // Load the task data + Recents.getTaskLoader().loadTaskData(task, true /* fetchAndInvalidateThumbnails */); + } + + private void unbindTaskView(TaskView tv, Task task) { + // Report that this task's data is no longer being used + Recents.getTaskLoader().unloadTaskData(task); + } + /**** TaskViewCallbacks Implementation ****/ @Override |