From 7a48f57043c7938fcbd9e3a504ad3f2e0413fea9 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Tue, 6 Jun 2023 15:30:38 -0700 Subject: [PATCH] Dismiss all task ids from TaskView In recents we were hardcoding that only two task ids can be dismissed when dismissing a TaskView. Update the logic to dismiss arbitrary number of task ids that are returned from TaskView. Fixes task dismissal logic for desktop where there can be more than 2 tasks represented by one taskview. Flag: not needed, trivial change Bug: 280830106 Test: Add chrome, files and calculator to desktop. Dismiss the desktop tile with 3 apps from overview. Open youtube and move it to desktop. Observe that desktop only contains youtube. None of the 3 previous apps are added back. Test: Move 2 apps to split screen, dismiss the split tile from overview. Observe both apps are dismissed. Test: Dismiss a single app from overview. Change-Id: I139943f5d678d63f449116de26debae9be122b21 --- .../src/com/android/quickstep/views/RecentsView.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 3142c9e492..f4b3a32b14 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -3960,13 +3960,12 @@ public abstract class RecentsView { - ActivityManagerWrapper.getInstance().removeTask(primaryTaskId); - if (secondaryTaskId != -1) { - ActivityManagerWrapper.getInstance().removeTask(secondaryTaskId); + for (int taskId : taskIds) { + if (taskId != -1) { + ActivityManagerWrapper.getInstance().removeTask(taskId); + } } }); }