Fix pip enter crash in landscape split-screen pair
On the mobile device, select two apps to enter split screen mode and switch to landscape, then click the button to enter PIP. Crashes may occur when starting a new Activity as a pip activity, e.g. Weibo.
Bug: 382303517
Test: Enable auto rotation.
Enter split screen with Task A and Task B.
Rotate to landscape.
A uses application context to launch a translucent Task C.
C sets orientation to portrait and calls enterPip when creating.
Change-Id: I78dcc2c3a116784556b1487aff7f6c54c8c52279
Signed-off-by: renbin3 <renbin3@xiaomi.com>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index 4287daa..4f22c14 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -2871,7 +2871,8 @@
mSplitLayout.update(startTransaction, false /* resetImePosition */);
}
- if (mMixedHandler.isEnteringPip(change, transitType)) {
+ if (mMixedHandler.isEnteringPip(change, transitType)
+ && getSplitItemStage(change.getLastParent()) != STAGE_TYPE_UNDEFINED) {
pipChange = change;
}