Snap for 12596819 from 22a60f4940 to 25Q1-release

Change-Id: I4f3040e0c315933ef1bb51a54879616aa03563f2
This commit is contained in:
Android Build Coastguard Worker
2024-11-02 21:22:21 +00:00
@@ -1245,21 +1245,24 @@ public abstract class RecentsView<
// - It's the focused task to be moved to the front, we immediately re-add the task
if (child instanceof TaskView && child != mSplitHiddenTaskView
&& child != mMovingTaskView) {
TaskView taskView = (TaskView) child;
for (int i : taskView.getTaskIds()) {
mHasVisibleTaskData.delete(i);
}
if (child instanceof GroupedTaskView) {
mGroupedTaskViewPool.recycle((GroupedTaskView) taskView);
} else if (child instanceof DesktopTaskView) {
mDesktopTaskViewPool.recycle((DesktopTaskView) taskView);
} else {
mTaskViewPool.recycle(taskView);
}
mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0);
clearAndRecycleTaskView((TaskView) child);
}
}
private void clearAndRecycleTaskView(TaskView taskView) {
for (int taskId : taskView.getTaskIds()) {
mHasVisibleTaskData.delete(taskId);
}
if (taskView instanceof GroupedTaskView) {
mGroupedTaskViewPool.recycle((GroupedTaskView) taskView);
} else if (taskView instanceof DesktopTaskView) {
mDesktopTaskViewPool.recycle((DesktopTaskView) taskView);
} else {
mTaskViewPool.recycle(taskView);
}
mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0);
}
@Override
public void onViewAdded(View child) {
super.onViewAdded(child);
@@ -5303,6 +5306,13 @@ public abstract class RecentsView<
mSplitHiddenTaskViewIndex = -1;
if (mSplitHiddenTaskView != null) {
mSplitHiddenTaskView.setThumbnailVisibility(VISIBLE, INVALID_TASK_ID);
// mSplitHiddenTaskView is set when split select animation starts. The TaskView is only
// removed when when the animation finishes. So in the case of overview being dismissed
// during the animation, we should not call clearAndRecycleTaskView() because it has
// not been removed yet.
if (mSplitHiddenTaskView.getParent() == null) {
clearAndRecycleTaskView(mSplitHiddenTaskView);
}
mSplitHiddenTaskView = null;
}
}