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
This commit is contained in:
Vinit Nayak
2023-07-05 18:21:59 -07:00
parent 1e3d799fe3
commit 8082401a83
2 changed files with 17 additions and 4 deletions
@@ -561,7 +561,7 @@ public class SplitSelectStateController {
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()) {
@@ -223,11 +223,12 @@ public class GroupedTaskView extends TaskView {
// 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 @@ public class GroupedTaskView extends TaskView {
@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());
}