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

Commit 565c0b23 authored by Jerry Chang's avatar Jerry Chang
Browse files

Fix not able to launch activity adjacently

Make it considers launch flags when finding launch root for existing
activity and add back set launch adjacent flag root task logic which was
accidently removed by Ie259abc1.

Fix: 204578587
Test: launch new/existing activity with launch-adjacent-flag will launch
      into split root and trigger split screen.
Test: passed existing tests
Change-Id: I0e637c198de9c7b08e27864771cebd951e4fdac2
parent c35cf07c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -768,6 +768,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            final WindowContainerTransaction wct = new WindowContainerTransaction();
            // Make the stages adjacent to each other so they occlude what's behind them.
            wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
            wct.setLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token);
            mTaskOrganizer.applyTransaction(wct);
        }
    }
@@ -775,6 +776,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    private void onStageRootTaskVanished(StageListenerImpl stageListener) {
        if (stageListener == mMainStageListener || stageListener == mSideStageListener) {
            final WindowContainerTransaction wct = new WindowContainerTransaction();
            wct.clearLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token);
            // Deactivate the main stage if it no longer has a root task.
            mMainStage.deactivate(wct);
            mTaskOrganizer.applyTransaction(wct);
+2 −2
Original line number Diff line number Diff line
@@ -2741,8 +2741,8 @@ class ActivityStarter {
        // If it exist, we need to reparent target root task from TDA to launch root task.
        final TaskDisplayArea tda = mTargetRootTask.getDisplayArea();
        final Task launchRootTask = tda.getLaunchRootTask(mTargetRootTask.getWindowingMode(),
                mTargetRootTask.getActivityType(), null /** options */,
                mSourceRootTask, 0 /** launchFlags */);
                mTargetRootTask.getActivityType(), null /** options */, mSourceRootTask,
                mLaunchFlags);
        // If target root task is created by organizer, let organizer handle reparent itself.
        if (!mTargetRootTask.mCreatedByOrganizer && launchRootTask != null
                && launchRootTask != mTargetRootTask) {