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

Commit 782fc415 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "Do not create window decorations for split roots" into udc-dev

parents 6ddd9681 1bd14bc4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -337,6 +337,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
        return isTaskInSplitScreen(taskId) && isSplitScreenVisible();
    }

    /** Check whether the task is the single-top root or the root of one of the stages. */
    public boolean isTaskRootOrStageRoot(int taskId) {
        return mStageCoordinator.isRootOrStageRoot(taskId);
    }

    public @SplitPosition int getSplitPosition(int taskId) {
        return mStageCoordinator.getSplitPosition(taskId);
    }
+7 −0
Original line number Diff line number Diff line
@@ -377,6 +377,13 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        return STAGE_TYPE_UNDEFINED;
    }

    boolean isRootOrStageRoot(int taskId) {
        if (mRootTaskInfo != null && mRootTaskInfo.taskId == taskId) {
            return true;
        }
        return mMainStage.isRootTaskId(taskId) || mSideStage.isRootTaskId(taskId);
    }

    boolean moveToStage(ActivityManager.RunningTaskInfo task, @SplitPosition int stagePosition,
            WindowContainerTransaction wct) {
        prepareEnterSplitScreen(wct, task, stagePosition);
+4 −0
Original line number Diff line number Diff line
@@ -286,6 +286,10 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
        }
    }

    boolean isRootTaskId(int taskId) {
        return mRootTaskInfo != null && mRootTaskInfo.taskId == taskId;
    }

    void onResizing(Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX,
            int offsetY, boolean immediately) {
        if (mSplitDecorManager != null && mRootTaskInfo != null) {
+4 −0
Original line number Diff line number Diff line
@@ -760,6 +760,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {

    private boolean shouldShowWindowDecor(RunningTaskInfo taskInfo) {
        if (taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) return true;
        if (mSplitScreenController.isPresent()
                && mSplitScreenController.get().isTaskRootOrStageRoot(taskInfo.taskId)) {
            return false;
        }
        return DesktopModeStatus.isProto2Enabled()
                && taskInfo.getActivityType() == ACTIVITY_TYPE_STANDARD
                && mDisplayController.getDisplayContext(taskInfo.displayId)