Loading quickstep/src/com/android/quickstep/views/RecentsView.java +13 −11 Original line number Diff line number Diff line Loading @@ -2734,18 +2734,20 @@ public abstract class RecentsView<CONTAINER_TYPE extends Context & RecentsViewCo * Returns true if we should add a stub taskView for the running task id */ protected boolean shouldAddStubTaskView(Task[] runningTasks) { TaskView taskView = getTaskViewByTaskId(runningTasks[0].key.id); if (taskView == null) { // No TaskView found, add a stub task. return true; } if (runningTasks.length > 1) { TaskView primaryTaskView = getTaskViewByTaskId(runningTasks[0].key.id); TaskView secondaryTaskView = getTaskViewByTaskId(runningTasks[1].key.id); 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; } Task runningTaskInfo = runningTasks[0]; return runningTaskInfo != null && getTaskViewByTaskId(runningTaskInfo.key.id) == null; // Ensure all taskIds matches the TaskView, otherwise add a stub task. return Arrays.stream(runningTasks).anyMatch( runningTask -> !taskView.containsTaskId(runningTask.key.id)); } else { // Ensure the TaskView only contains a single taskId, otherwise add a stub task. return taskView.containsMultipleTasks(); } } /** Loading Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +13 −11 Original line number Diff line number Diff line Loading @@ -2734,18 +2734,20 @@ public abstract class RecentsView<CONTAINER_TYPE extends Context & RecentsViewCo * Returns true if we should add a stub taskView for the running task id */ protected boolean shouldAddStubTaskView(Task[] runningTasks) { TaskView taskView = getTaskViewByTaskId(runningTasks[0].key.id); if (taskView == null) { // No TaskView found, add a stub task. return true; } if (runningTasks.length > 1) { TaskView primaryTaskView = getTaskViewByTaskId(runningTasks[0].key.id); TaskView secondaryTaskView = getTaskViewByTaskId(runningTasks[1].key.id); 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; } Task runningTaskInfo = runningTasks[0]; return runningTaskInfo != null && getTaskViewByTaskId(runningTaskInfo.key.id) == null; // Ensure all taskIds matches the TaskView, otherwise add a stub task. return Arrays.stream(runningTasks).anyMatch( runningTask -> !taskView.containsTaskId(runningTask.key.id)); } else { // Ensure the TaskView only contains a single taskId, otherwise add a stub task. return taskView.containsMultipleTasks(); } } /** Loading