Fix not clearing split pair record after auto-enter pip

Due to the swipe-to-home and entering pip are in separate transitions.
The split record was not removed after startAnimation, updates to remove
it when identified in handleRequest.

Bug: 273410079
Test: repro steps of the bug
Change-Id: Iad54a3d87c1d926e4148c937712e45fdc44d6e82
This commit is contained in:
Jerry Chang
2023-05-12 12:22:36 +00:00
parent dad2f513c4
commit 99490ee0d7

View File

@@ -23,6 +23,7 @@ import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVIT
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.content.res.Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.RemoteAnimationTarget.MODE_OPENING;
@@ -2377,6 +2378,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
+ " so make sure split-screen state is cleaned-up. "
+ "mainStageCount=%d sideStageCount=%d", mMainStage.getChildCount(),
mSideStage.getChildCount());
if (triggerTask != null) {
mRecentTasks.ifPresent(
recentTasks -> recentTasks.removeSplitPair(triggerTask.taskId));
}
prepareExitSplitScreen(STAGE_TYPE_UNDEFINED, outWCT);
}
}
@@ -2765,7 +2770,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
for (TransitionInfo.Change change : info.getChanges()) {
final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
if (taskInfo != null
&& taskInfo.getWindowingMode() == WINDOWING_MODE_FULLSCREEN) {
&& taskInfo.getWindowingMode() != WINDOWING_MODE_MULTI_WINDOW) {
recentTasks.removeSplitPair(taskInfo.taskId);
}
}