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

Commit 3f11ab66 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Allow non-resizable apps in split-screen (11/n)" into sc-dev

parents f5646294 13deafc4
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -94,11 +94,6 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
                taskInfo.taskId);
    }

    @Override
    public boolean supportSizeCompatUI() {
        return true;
    }

    @Override
    public void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
        if (!mLeashByTaskId.contains(taskId)) {
+2 −1
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@ public class ShellTaskOrganizer extends TaskOrganizer {
        default void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) {}
        /** Whether this task listener supports size compat UI. */
        default boolean supportSizeCompatUI() {
            return false;
            // All TaskListeners should support size compat except PIP.
            return true;
        }
        /** Attaches the a child window surface to the task surface. */
        default void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
+8 −0
Original line number Diff line number Diff line
@@ -300,6 +300,14 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
        }
    }

    @Override
    public void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
        if (mTaskInfo.taskId != taskId) {
            throw new IllegalArgumentException("There is no surface for taskId=" + taskId);
        }
        b.setParent(mTaskLeash);
    }

    @Override
    public void dump(@androidx.annotation.NonNull PrintWriter pw, String prefix) {
        final String innerPrefix = prefix + "  ";
+13 −0
Original line number Diff line number Diff line
@@ -213,6 +213,19 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.LayoutChan
        }
    }

    @Override
    public void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
        if (getRootTaskId() == taskId) {
            b.setParent(mRootTaskLeash);
        } else if (getTaskId1() == taskId) {
            b.setParent(mTaskLeash1);
        } else if (getTaskId2() == taskId) {
            b.setParent(mTaskLeash2);
        } else {
            throw new IllegalArgumentException("There is no surface for taskId=" + taskId);
        }
    }

    @Override
    public void dump(@NonNull PrintWriter pw, String prefix) {
        final String innerPrefix = prefix + "  ";
+8 −0
Original line number Diff line number Diff line
@@ -322,6 +322,14 @@ class LegacySplitScreenTaskListener implements ShellTaskOrganizer.TaskListener {
        }
    }

    @Override
    public void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
        if (!mLeashByTaskId.contains(taskId)) {
            throw new IllegalArgumentException("There is no surface for taskId=" + taskId);
        }
        b.setParent(mLeashByTaskId.get(taskId));
    }

    @Override
    public void dump(@NonNull PrintWriter pw, String prefix) {
        final String innerPrefix = prefix + "  ";
Loading