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

Commit 5e5e8646 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 am: 348ed55e

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

Change-Id: Id39ffd659a1c27f9ce9fa4eed2e74da1849f2b53
parents 7e5c35b5 348ed55e
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) {