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

Commit 80025c08 authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Fix launch adjacent behavior if split background" into udc-dev am:...

Merge "Fix launch adjacent behavior if split background" into udc-dev am: 741dd914 am: 5980f2b7 am: 855629a8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23367664



Change-Id: I3a86f52ac0a0460461d912b1ab572a8569f7a0e8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5de7a82e 855629a8
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -2303,6 +2303,13 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    prepareExitSplitScreen(dismissTop, out);
                    mSplitTransitions.setDismissTransition(transition, dismissTop,
                            EXIT_REASON_APP_FINISHED);
                } else if (!isSplitScreenVisible() && isOpening) {
                    // If split running backgroud and trigger task is appearing into split,
                    // prepare to enter split screen.
                    prepareEnterSplitScreen(out);
                    mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
                            null /* consumedCallback */, null /* finishedCallback */,
                            TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
                }
            } else if (isOpening && inFullscreen) {
                final int activityType = triggerTask.getActivityType();
@@ -2328,7 +2335,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                prepareEnterSplitScreen(out);
                mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
                        null /* consumedCallback */, null /* finishedCallback */,
                        TRANSIT_SPLIT_SCREEN_OPEN_TO_SIDE, !mIsDropEntering);
                        TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
            }
        }
        return out;
@@ -2586,6 +2593,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        // First, verify that we actually have opened apps in both splits.
        TransitionInfo.Change mainChild = null;
        TransitionInfo.Change sideChild = null;
        final WindowContainerTransaction evictWct = new WindowContainerTransaction();
        for (int iC = 0; iC < info.getChanges().size(); ++iC) {
            final TransitionInfo.Change change = info.getChanges().get(iC);
            final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
@@ -2594,12 +2602,16 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                continue;
            }
            final @StageType int stageType = getStageType(getStageOfTask(taskInfo));
            if (stageType == STAGE_TYPE_MAIN
            if (mainChild == null && stageType == STAGE_TYPE_MAIN
                    && (isOpeningType(change.getMode()) || change.getMode() == TRANSIT_CHANGE)) {
                // Includes TRANSIT_CHANGE to cover reparenting top-most task to split.
                mainChild = change;
            } else if (stageType == STAGE_TYPE_SIDE && isOpeningType(change.getMode())) {
            } else if (sideChild == null && stageType == STAGE_TYPE_SIDE
                    && isOpeningType(change.getMode())) {
                sideChild = change;
            } else if (stageType != STAGE_TYPE_UNDEFINED && change.getMode() == TRANSIT_TO_BACK) {
                // Collect all to back task's and evict them when transition finished.
                evictWct.reparent(taskInfo.token, null /* parent */, false /* onTop */);
            }
        }

@@ -2661,6 +2673,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    mSideStage.evictInvisibleChildren(callbackWct);
                }
            }
            if (!evictWct.isEmpty()) {
                callbackWct.merge(evictWct, true);
            }
            if (enterTransition.mResizeAnim) {
                mShowDecorImmediately = true;
                mSplitLayout.flingDividerToCenter();