diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index f0e57c9932..e863a89b10 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1144,17 +1144,6 @@ public abstract class RecentsView 1) { - // * Always create new view for GroupedTaskView - // * Remove existing associated taskViews for tasks currently in split - for (RunningTaskInfo rti : runningTaskInfos) { - TaskView taskView = getTaskViewByTaskId(rti.taskId); - if (taskView == null) { - continue; - } - taskView.onTaskListVisibilityChanged(false); - removeView(taskView); - } - return true; + TaskView primaryTaskView = getTaskViewByTaskId(runningTaskInfos[0].taskId); + TaskView secondaryTaskView = getTaskViewByTaskId(runningTaskInfos[1].taskId); + int leftTopTaskViewId = + (primaryTaskView == null) ? -1 : primaryTaskView.getTaskViewId(); + int rightBottomTaskViewId = + (secondaryTaskView == null) ? -1 : secondaryTaskView.getTaskViewId(); + // Add a new stub view if both taskIds don't match any taskViews + return leftTopTaskViewId != rightBottomTaskViewId || leftTopTaskViewId == -1; } RunningTaskInfo runningTaskInfo = runningTaskInfos[0]; return runningTaskInfo != null && getTaskViewByTaskId(runningTaskInfo.taskId) == null; @@ -2246,7 +2232,7 @@ public abstract class RecentsView