Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 085eef0f authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Prevent putting any stage on top if split is not visible when breaking pair" into main

parents c02c5e89 e8fa7b03
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -3515,7 +3515,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);
@@ -3524,9 +3530,11 @@ 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"));
                if (splitScreenVisible) {
                    mSplitUnsupportedToast.show();
                }
            }
        }

        private void reset() {
            mHasRootTask = false;