diff options
author | Vinit Nayak <peanutbutter@google.com> | 2022-01-10 15:59:33 -0800 |
---|---|---|
committer | Vinit Nayak <peanutbutter@google.com> | 2022-01-10 15:59:33 -0800 |
commit | 2c97c4ab19557d105bcc0c0ac0b050014c1b1bf5 (patch) | |
tree | b4c4ce4bb2bbe3d7f9583a6fd6785c9253817ef4 /quickstep/src | |
parent | d873788275be1d4787828e21a3d24e4f88798c3a (diff) |
Remove code that assumes single GroupedTaskView
* Old code assumes there will only be a single
GroupedTaskView, removing those code paths helps
consolidate single and grouped task code flows
* Correctly check when we need to add a stub
taskView for GroupedTaskViews by checking each
individual taskId
Test: Swiping with multiple split pairs doesn't
cause a cycle
Fixes: 213355942
Change-Id: Ibb98ae0dfcd4f52b762685aec9d2ee6445b9ef54
Diffstat (limited to 'quickstep/src')
-rw-r--r-- | quickstep/src/com/android/quickstep/views/RecentsView.java | 32 |
1 files changed, 9 insertions, 23 deletions
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<ACTIVITY_TYPE extends StatefulActivity<STATE_T // Reset the running task when leaving overview since it can still have a reference to // its thumbnail mTmpRunningTasks = null; - // Remove grouped tasks and recycle once we exit overview - int taskCount = getTaskViewCount(); - for (int i = 0; i < taskCount; i++) { - View v = getTaskViewAt(i); - if (!(v instanceof GroupedTaskView)) { - return; - } - GroupedTaskView gtv = (GroupedTaskView) v; - gtv.onTaskListVisibilityChanged(false); - removeView(gtv); - } mSplitBoundsConfig = null; } updateLocusId(); @@ -2185,17 +2174,14 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T */ protected boolean shouldAddStubTaskView(RunningTaskInfo[] runningTaskInfos) { if (runningTaskInfos.length > 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<ACTIVITY_TYPE extends StatefulActivity<STATE_T measure(makeMeasureSpec(getMeasuredWidth(), EXACTLY), makeMeasureSpec(getMeasuredHeight(), EXACTLY)); layout(getLeft(), getTop(), getRight(), getBottom()); - } else if (!needGroupTaskView && getTaskViewByTaskId(taskInfo.taskId) != null) { + } else if (getTaskViewByTaskId(taskInfo.taskId) != null) { runningTaskViewId = getTaskViewByTaskId(taskInfo.taskId).getTaskViewId(); } |