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

Commit f379f80b authored by Louis Chang's avatar Louis Chang
Browse files

Removing supports for creating stack on display

The API of creating a stack on certain display was intended
to create a container that can launch activities within.
Since activities now can be launched to any display by
specifying display id. This is no longer necessary.

Bug: 111363427
Test: atest ActivityManagerPinnedStackTests#testEnterPipWithResumeWhilePausingActivityNoStop

Change-Id: I89635d4e744672b79f5a60a8019f2ff93413e1df
parent 0f18470e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ interface IActivityTaskManager {
    void startInPlaceAnimationOnFrontMostApplication(in Bundle opts);
    void registerTaskStackListener(in ITaskStackListener listener);
    void unregisterTaskStackListener(in ITaskStackListener listener);
    int createStackOnDisplay(int displayId);
    void setTaskResizeable(int taskId, int resizeableMode);
    void exitFreeformMode(in IBinder token);
    void resizeTask(int taskId, in Rect bounds, int resizeMode);
+1 −29
Original line number Diff line number Diff line
@@ -2393,8 +2393,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
    int runStack(PrintWriter pw) throws RemoteException {
        String op = getNextArgRequired();
        switch (op) {
            case "start":
                return runStackStart(pw);
            case "move-task":
                return runStackMoveTask(pw);
            case "resize":
@@ -2457,31 +2455,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
        return 0;
    }

    int runStackStart(PrintWriter pw) throws RemoteException {
        String displayIdStr = getNextArgRequired();
        int displayId = Integer.parseInt(displayIdStr);
        Intent intent;
        try {
            intent = makeIntent(UserHandle.USER_CURRENT);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e.getMessage(), e);
        }

        final int stackId = mTaskInterface.createStackOnDisplay(displayId);
        if (stackId != INVALID_STACK_ID) {
            // TODO: Need proper support if this is used by test...
//            container.startActivity(intent);
//            ActivityOptions options = ActivityOptions.makeBasic();
//            options.setLaunchDisplayId(displayId);
//            options.setLaunchStackId(stackId);
//            mInterface.startAct
//            mInterface.startActivityAsUser(null, null, intent, mimeType,
//                    null, null, 0, mStartFlags, profilerInfo,
//                    options != null ? options.toBundle() : null, mUserId);
        }
        return 0;
    }

    int runStackMoveTask(PrintWriter pw) throws RemoteException {
        String taskIdStr = getNextArgRequired();
        int taskId = Integer.parseInt(taskIdStr);
@@ -2904,6 +2877,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
            pw.println("          specified then run as the current user.");
            pw.println("      --windowingMode <WINDOWING_MODE>: The windowing mode to launch the activity into.");
            pw.println("      --activityType <ACTIVITY_TYPE>: The activity type to launch the activity as.");
            pw.println("      --display <DISPLAY_ID>: The display to launch the activity into.");
            pw.println("  start-service [--user <USER_ID> | current] <INTENT>");
            pw.println("      Start a Service.  Options are:");
            pw.println("      --user <USER_ID> | current: Specify which user to run as; if not");
@@ -3068,8 +3042,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
            pw.println("       move-stack <STACK_ID> <DISPLAY_ID>");
            pw.println("           Move <STACK_ID> from its current display to <DISPLAY_ID>.");
            pw.println("  stack [COMMAND] [...]: sub-commands for operating on activity stacks.");
            pw.println("       start <DISPLAY_ID> <INTENT>");
            pw.println("           Start a new activity on <DISPLAY_ID> using <INTENT>");
            pw.println("       move-task <TASK_ID> <STACK_ID> [true|false]");
            pw.println("           Move <TASK_ID> from its current stack to the top (true) or");
            pw.println("           bottom (false) of <STACK_ID>.");
+0 −17
Original line number Diff line number Diff line
@@ -2771,23 +2771,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        }
    }

    @Override
    public int createStackOnDisplay(int displayId) {
        mAmInternal.enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "createStackOnDisplay()");
        synchronized (mGlobalLock) {
            final ActivityDisplay display =
                    mStackSupervisor.getActivityDisplayOrCreateLocked(displayId);
            if (display == null) {
                return INVALID_STACK_ID;
            }
            // TODO(multi-display): Have the caller pass in the windowing mode and activity type.
            final ActivityStack stack = display.createStack(
                    WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY, ACTIVITY_TYPE_STANDARD,
                    ON_TOP);
            return (stack != null) ? stack.mStackId : INVALID_STACK_ID;
        }
    }

    @Override
    public void exitFreeformMode(IBinder token) {
        synchronized (mGlobalLock) {