diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index a1c9f05adb..54154d0a34 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -98,7 +98,6 @@ import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.touch.ItemClickHandler; import com.android.launcher3.touch.ItemClickHandler.ItemClickProxy; import com.android.launcher3.util.ActivityOptionsWrapper; -import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors; import com.android.launcher3.util.NavigationMode; @@ -939,9 +938,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext { if (recents == null) { return; } - ComponentKey componentToBeLaunched = new ComponentKey(info.getTargetComponent(), info.user); recents.getSplitSelectController().findLastActiveTaskAndRunCallback( - componentToBeLaunched, + info.getComponentKey(), foundTask -> { if (foundTask != null) { TaskView foundTaskView = diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java index be5cbac142..7154731ee5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java @@ -34,7 +34,6 @@ import com.android.launcher3.Utilities; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.ItemInfoWithIcon; import com.android.launcher3.popup.SystemShortcut; -import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.quickstep.util.GroupTask; @@ -205,11 +204,8 @@ public class TaskbarUIController { return; } - ComponentKey componentToBeStaged = new ComponentKey( - splitSelectSource.itemInfo.getTargetComponent(), - splitSelectSource.itemInfo.user); recentsView.getSplitSelectController().findLastActiveTaskAndRunCallback( - componentToBeStaged, + splitSelectSource.itemInfo.getComponentKey(), foundTask -> { splitSelectSource.alreadyRunningTaskId = foundTask == null ? INVALID_TASK_ID @@ -225,9 +221,8 @@ public class TaskbarUIController { */ public void triggerSecondAppForSplit(ItemInfoWithIcon info, Intent intent, View startingView) { RecentsView recents = getRecentsView(); - ComponentKey secondAppComponent = new ComponentKey(info.getTargetComponent(), info.user); recents.getSplitSelectController().findLastActiveTaskAndRunCallback( - secondAppComponent, + info.getComponentKey(), foundTask -> { if (foundTask != null) { TaskView foundTaskView = recents.getTaskViewByTaskId(foundTask.key.id); diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index e4e888030f..658bf2d865 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -142,7 +142,6 @@ import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchControlle import com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController; import com.android.launcher3.uioverrides.touchcontrollers.TwoButtonNavbarTouchController; import com.android.launcher3.util.ActivityOptionsWrapper; -import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors; import com.android.launcher3.util.IntSet; @@ -601,13 +600,10 @@ public class QuickstepLauncher extends Launcher { @Override public void startSplitSelection(SplitSelectSource splitSelectSource) { RecentsView recentsView = getOverviewPanel(); - ComponentKey componentToBeStaged = new ComponentKey( - splitSelectSource.itemInfo.getTargetComponent(), - splitSelectSource.itemInfo.user); // Check if there is already an instance of this app running, if so, initiate the split // using that. mSplitSelectStateController.findLastActiveTaskAndRunCallback( - componentToBeStaged, + splitSelectSource.itemInfo.getComponentKey(), foundTask -> { splitSelectSource.alreadyRunningTaskId = foundTask == null ? INVALID_TASK_ID diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index 45df831674..f25619d963 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -202,13 +202,17 @@ public class SplitSelectStateController { * Pulls the list of active Tasks from RecentsModel, and finds the most recently active Task * matching a given ComponentName. Then uses that Task (which could be null) with the given * callback. - * + *
* Used in various task-switching or splitscreen operations when we need to check if there is a
* currently running Task of a certain type and use the most recent one.
*/
- public void findLastActiveTaskAndRunCallback(ComponentKey componentKey,
- Consumer