diff options
| author | 2024-02-29 18:09:21 -0800 | |
|---|---|---|
| committer | 2024-02-29 18:09:21 -0800 | |
| commit | e8fa7b03f3d540c5ac7fe8e5482d9d106d56a33d (patch) | |
| tree | b89aca96a03244260b189b30347ad7995551730b | |
| parent | 688a322b1f19106d241d13a278b3915ced9bf6d5 (diff) | |
Prevent putting any stage on top if split is not visible when breaking pair
* If the split breaks in the background when split is not
visible, we don't put any stage on top
Test: Tested w/ Camera + Messages, toast and app don't
show up if you swipe to home before folding the device
Fixes: 323461567
Change-Id: I4ebce1ce795976a1ec61b8e1f35c8840863e4f92
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java | 12 |
1 files changed, 10 insertions, 2 deletions
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 2933cf48614a..5d332188a3e0 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 @@ -3393,7 +3393,13 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, return; } - final int stageType = isMainStage ? STAGE_TYPE_MAIN : STAGE_TYPE_SIDE; + // If visible, we preserve the app and keep it running. If an app becomes + // unsupported in the bg, break split without putting anything on top + boolean splitScreenVisible = isSplitScreenVisible(); + int stageType = STAGE_TYPE_UNDEFINED; + if (splitScreenVisible) { + stageType = isMainStage ? STAGE_TYPE_MAIN : STAGE_TYPE_SIDE; + } final WindowContainerTransaction wct = new WindowContainerTransaction(); prepareExitSplitScreen(stageType, wct); clearSplitPairedInRecents(EXIT_REASON_APP_DOES_NOT_SUPPORT_MULTIWINDOW); @@ -3402,7 +3408,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, Log.w(TAG, splitFailureMessage("onNoLongerSupportMultiWindow", "app package " + taskInfo.baseActivity.getPackageName() + " does not support splitscreen, or is a controlled activity type")); - mSplitUnsupportedToast.show(); + if (splitScreenVisible) { + mSplitUnsupportedToast.show(); + } } } |