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

Commit 348ed55e authored by Jerry Chang's avatar Jerry Chang Committed by Automerger Merge Worker
Browse files

Merge "Fix empty side stage after dropping foreground app icon to split" into...

Merge "Fix empty side stage after dropping foreground app icon to split" into sc-v2-dev am: 0b11b5e7

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

Change-Id: I7df648a62c9c4020cac144bcfdf84fe58efd95c4
parents 28f33f8f 0b11b5e7
Loading
Loading
Loading
Loading
+3 −17
Original line number Diff line number Diff line
@@ -375,7 +375,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                if (options == null) {
                    options = new Bundle();
                }
                updateActivityOptions(options, position, wct);
                updateActivityOptions(options, position);
                break;
            }
            case STAGE_TYPE_MAIN: {
@@ -390,7 +390,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                if (options == null) {
                    options = new Bundle();
                }
                updateActivityOptions(options, position, wct);
                updateActivityOptions(options, position);
                break;
            }
            default:
@@ -491,22 +491,8 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        opts.putParcelable(KEY_LAUNCH_ROOT_TASK_TOKEN, stage.mRootTaskInfo.token);
    }

    void updateActivityOptions(Bundle opts, @SplitPosition int position,
            @Nullable WindowContainerTransaction wct) {
    void updateActivityOptions(Bundle opts, @SplitPosition int position) {
        addActivityOptions(opts, position == mSideStagePosition ? mSideStage : mMainStage);

        if (!mMainStage.isActive()) {
            // Activate the main stage in anticipation of an app launch.
            boolean needsApply = wct == null;
            if (needsApply) {
                wct = new WindowContainerTransaction();
            }
            mMainStage.activate(getMainStageBounds(), wct);
            mSideStage.setBounds(getSideStageBounds(), wct);
            if (needsApply) {
                mTaskOrganizer.applyTransaction(wct);
            }
        }
    }

    void registerSplitScreenListener(SplitScreen.SplitScreenListener listener) {