summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Chang <chengjeff@google.com> 2023-03-23 20:49:05 +0800
committer Jeff Chang <chengjeff@google.com> 2023-03-25 03:18:50 +0000
commit26b95e4b14cb35482dafb180cc9cd8efbe3bec48 (patch)
treec3651fd54c53b719ca286feb59d7cfc87d6de065
parenta3214b68b2f3c1b516bc065ec8660195a3acb9db (diff)
Prevent starting split pending transition when it exists
There is a validation to check whether an empty child exists in split from startAnimation. The IllegalStateException is thrown to say “Somehow removed the last task in a stage outside of a proper transition”. There is a case to run into this situation situation that makes a split first and launches an unsupported multi-window activity. The onNoLongerSupportMultiWindow() is invoked and starts a dismiss transition. Since the trampoline launch design, the onNoLongerSupportMultiWindow() is coming and triggers another dismiss transition. That makes the 2nd transition not consistent while the startAnimation() is invoked. This CL skip to set the pending transition if there is one existing. Also apply the same protection to enter pendingTransition. Bug: 273871464 Bug: 274835996 Test: (A|B) → C,C1 which do not support multi-window Change-Id: I2ccff5402e9bd14cbed43a730fcd07c564725408
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java
index e09c3c9e4d3f..ebdaaa9aa4a9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java
@@ -296,6 +296,11 @@ class SplitScreenTransitions {
Transitions.TransitionHandler handler,
@Nullable TransitionConsumedCallback consumedCallback,
@Nullable TransitionFinishedCallback finishedCallback) {
+ if (mPendingEnter != null) {
+ ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " splitTransition "
+ + " skip to start enter split transition since it already exist. ");
+ return null;
+ }
final IBinder transition = mTransitions.startTransition(transitType, wct, handler);
setEnterTransition(transition, remoteTransition, consumedCallback, finishedCallback);
return transition;
@@ -323,6 +328,12 @@ class SplitScreenTransitions {
IBinder startDismissTransition(WindowContainerTransaction wct,
Transitions.TransitionHandler handler, @SplitScreen.StageType int dismissTop,
@SplitScreenController.ExitReason int reason) {
+ if (mPendingDismiss != null) {
+ ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " splitTransition "
+ + " skip to start dismiss split transition since it already exist. reason to "
+ + " dismiss = %s", exitReasonToString(reason));
+ return null;
+ }
final int type = reason == EXIT_REASON_DRAG_DIVIDER
? TRANSIT_SPLIT_DISMISS_SNAP : TRANSIT_SPLIT_DISMISS;
IBinder transition = mTransitions.startTransition(type, wct, handler);