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

Commit 5b2ab551 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Remove unused API removeFromSideStage

Bug: 349828130
Test: Compiles
Flag: EXEMPT refactor
Change-Id: I8a859e3f600de0d4233c33f8446aef8c710dc01d
parent c09e63ed
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -54,11 +54,6 @@ interface ISplitScreen {
     */
     */
    oneway void unregisterSplitSelectListener(in ISplitSelectListener listener) = 21;
    oneway void unregisterSplitSelectListener(in ISplitSelectListener listener) = 21;


    /**
     * Removes a task from the side stage.
     */
    oneway void removeFromSideStage(int taskId) = 4;

    /**
    /**
     * Removes the split-screen stages and leaving indicated task to top. Passing INVALID_TASK_ID
     * Removes the split-screen stages and leaving indicated task to top. Passing INVALID_TASK_ID
     * to indicate leaving no top task after leaving split-screen.
     * to indicate leaving no top task after leaving split-screen.
+0 −10
Original line number Original line Diff line number Diff line
@@ -378,10 +378,6 @@ public class SplitScreenController implements SplitDragPolicy.Starter,
        return mStageCoordinator.moveToStage(task, stagePosition, wct);
        return mStageCoordinator.moveToStage(task, stagePosition, wct);
    }
    }


    public boolean removeFromSideStage(int taskId) {
        return mStageCoordinator.removeFromSideStage(taskId);
    }

    public void setSideStagePosition(@SplitPosition int sideStagePosition) {
    public void setSideStagePosition(@SplitPosition int sideStagePosition) {
        mStageCoordinator.setSideStagePosition(sideStagePosition, null /* wct */);
        mStageCoordinator.setSideStagePosition(sideStagePosition, null /* wct */);
    }
    }
@@ -1176,12 +1172,6 @@ public class SplitScreenController implements SplitDragPolicy.Starter,
                    (controller) -> controller.exitSplitScreenOnHide(exitSplitScreenOnHide));
                    (controller) -> controller.exitSplitScreenOnHide(exitSplitScreenOnHide));
        }
        }


        @Override
        public void removeFromSideStage(int taskId) {
            executeRemoteCallWithTaskPermission(mController, "removeFromSideStage",
                    (controller) -> controller.removeFromSideStage(taskId));
        }

        @Override
        @Override
        public void startTask(int taskId, int position, @Nullable Bundle options) {
        public void startTask(int taskId, int position, @Nullable Bundle options) {
            executeRemoteCallWithTaskPermission(mController, "startTask",
            executeRemoteCallWithTaskPermission(mController, "startTask",
+0 −15
Original line number Original line Diff line number Diff line
@@ -40,8 +40,6 @@ public class SplitScreenShellCommandHandler implements
        switch (args[0]) {
        switch (args[0]) {
            case "moveToSideStage":
            case "moveToSideStage":
                return runMoveToSideStage(args, pw);
                return runMoveToSideStage(args, pw);
            case "removeFromSideStage":
                return runRemoveFromSideStage(args, pw);
            case "setSideStagePosition":
            case "setSideStagePosition":
                return runSetSideStagePosition(args, pw);
                return runSetSideStagePosition(args, pw);
            case "switchSplitPosition":
            case "switchSplitPosition":
@@ -67,17 +65,6 @@ public class SplitScreenShellCommandHandler implements
        return true;
        return true;
    }
    }


    private boolean runRemoveFromSideStage(String[] args, PrintWriter pw) {
        if (args.length < 2) {
            // First argument is the action name.
            pw.println("Error: task id should be provided as arguments");
            return false;
        }
        final int taskId = new Integer(args[1]);
        mController.removeFromSideStage(taskId);
        return true;
    }

    private boolean runSetSideStagePosition(String[] args, PrintWriter pw) {
    private boolean runSetSideStagePosition(String[] args, PrintWriter pw) {
        if (args.length < 2) {
        if (args.length < 2) {
            // First argument is the action name.
            // First argument is the action name.
@@ -109,8 +96,6 @@ public class SplitScreenShellCommandHandler implements
    public void printShellCommandHelp(PrintWriter pw, String prefix) {
    public void printShellCommandHelp(PrintWriter pw, String prefix) {
        pw.println(prefix + "moveToSideStage <taskId> <SideStagePosition>");
        pw.println(prefix + "moveToSideStage <taskId> <SideStagePosition>");
        pw.println(prefix + "  Move a task with given id in split-screen mode.");
        pw.println(prefix + "  Move a task with given id in split-screen mode.");
        pw.println(prefix + "removeFromSideStage <taskId>");
        pw.println(prefix + "  Remove a task with given id in split-screen mode.");
        pw.println(prefix + "setSideStagePosition <SideStagePosition>");
        pw.println(prefix + "setSideStagePosition <SideStagePosition>");
        pw.println(prefix + "  Sets the position of the side-stage.");
        pw.println(prefix + "  Sets the position of the side-stage.");
        pw.println(prefix + "switchSplitPosition");
        pw.println(prefix + "switchSplitPosition");
+0 −15
Original line number Original line Diff line number Diff line
@@ -499,21 +499,6 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        return true;
        return true;
    }
    }


    boolean removeFromSideStage(int taskId) {
        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "removeFromSideStage: task=%d", taskId);
        final WindowContainerTransaction wct = new WindowContainerTransaction();


        // MainStage will be deactivated in onStageHasChildrenChanged() if the other stages
        // no longer have children.

        final boolean result = mSideStage.removeTask(taskId,
                isSplitActive() ? mMainStage.mRootTaskInfo.token : null,
                wct);
        mTaskOrganizer.applyTransaction(wct);
        return result;
    }

    SplitscreenEventLogger getLogger() {
    SplitscreenEventLogger getLogger() {
        return mLogger;
        return mLogger;
    }
    }
+0 −11
Original line number Original line Diff line number Diff line
@@ -231,17 +231,6 @@ public class StageCoordinatorTests extends ShellTestCase {
        verify(listener).onSplitBoundsChanged(mRootBounds, mBounds1, mBounds2);
        verify(listener).onSplitBoundsChanged(mRootBounds, mBounds1, mBounds2);
    }
    }


    @Test
    public void testRemoveFromSideStage() {
        final ActivityManager.RunningTaskInfo task = new TestRunningTaskInfoBuilder().build();

        doReturn(false).when(mMainStage).isActive();
        mStageCoordinator.removeFromSideStage(task.taskId);

        verify(mSideStage).removeTask(
                eq(task.taskId), any(), any(WindowContainerTransaction.class));
    }

    @Test
    @Test
    public void testResolveStartStage_beforeSplitActivated_setsStagePosition() {
    public void testResolveStartStage_beforeSplitActivated_setsStagePosition() {
        mStageCoordinator.setSideStagePosition(SPLIT_POSITION_TOP_OR_LEFT, null /* wct */);
        mStageCoordinator.setSideStagePosition(SPLIT_POSITION_TOP_OR_LEFT, null /* wct */);