Prevent passing in GroupedTaskView when not animating split launch

* With ag/23320818 we started always passing in GroupedTaskView,
which gets used downstream to mean that we are launching an app
from tapping on it in overview
* This caused a bug in the case where we quickswitched to the last
task. Now we pass in null for GroupedTaskView like before

Test: Prior bug (b/274540670) doesn't occur, nor do repro steps
for this one
Fixes: 289163668
Flag: None

Change-Id: I82dd8f26bfc286fefc0995822786cf3980da41d0
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index e063b44..ff701e7 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -561,7 +561,7 @@
                 new RemoteSplitLaunchTransitionRunner(firstTaskId, secondTaskId, callback);
         final RemoteTransition remoteTransition = new RemoteTransition(animationRunner,
                 ActivityThread.currentActivityThread().getApplicationThread(),
-                "LaunchSplitPair");
+                "LaunchAppFullscreen");
         InstanceId instanceId = LogUtils.getShellShareableInstanceId().first;
         if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
             switch (launchData.getSplitLaunchType()) {
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
index c91b183..01f6ae8 100644
--- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
@@ -223,11 +223,12 @@
         // Callbacks run from remote animation when recents animation not currently running
         InteractionJankMonitorWrapper.begin(this,
                 InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Enter form GroupedTaskView");
-        launchTask(success -> {
+        launchTaskInternal(success -> {
             endCallback.executeAllAndDestroy();
             InteractionJankMonitorWrapper.end(
                     InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
-        }, false /* freezeTaskList */);
+        }, false /* freezeTaskList */, true /*launchingExistingTaskview*/);
+
 
         // Callbacks get run from recentsView for case when recents animation already running
         recentsView.addSideTaskLaunchCallback(endCallback);
@@ -236,7 +237,19 @@
 
     @Override
     public void launchTask(@NonNull Consumer<Boolean> callback, boolean isQuickswitch) {
-        getRecentsView().getSplitSelectController().launchExistingSplitPair(this, mTask.key.id,
+        launchTaskInternal(callback, isQuickswitch, false /*launchingExistingTaskview*/);
+    }
+
+    /**
+     * @param launchingExistingTaskView {@link SplitSelectStateController#launchExistingSplitPair}
+     * uses existence of GroupedTaskView as control flow of how to animate in the incoming task. If
+     * we're launching from overview (from overview thumbnails) then pass in {@code true},
+     * otherwise pass in {@code false} for case like quickswitching from home to task
+     */
+    private void launchTaskInternal(@NonNull Consumer<Boolean> callback, boolean isQuickswitch,
+            boolean launchingExistingTaskView) {
+        getRecentsView().getSplitSelectController().launchExistingSplitPair(
+                launchingExistingTaskView ? this : null, mTask.key.id,
                 mSecondaryTask.key.id, SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT,
                 callback, isQuickswitch, getSplitRatio());
     }