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

Commit b1faf60b authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Use resizeMode integer instead of resizeable boolean.

Changes activity manager and window manager to use resizeMode
as defined by ActivityInfo#resizeMode instead of a boolean.

Bug: 26774816
Change-Id: I8cef46d9fba6bfdd21df7da63ed5d5330ad03d4b
parent 8ab1a37b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ public class Am extends BaseCommand {
                "       am stack info <STACK_ID>\n" +
                "       am task lock <TASK_ID>\n" +
                "       am task lock stop\n" +
                "       am task resizeable <TASK_ID> [true|false]\n" +
                "       am task resizeable <TASK_ID> [0 (unresizeable) | 1 (crop_windows) | 2 (resizeable) | 3 (resizeable_and_pipable)]\n" +
                "       am task resize <TASK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" +
                "       am task drag-task-test <TASK_ID> <STEP_SIZE> [DELAY_MS] \n" +
                "       am task size-task-test <TASK_ID> <STEP_SIZE> [DELAY_MS] \n" +
@@ -323,7 +323,8 @@ public class Am extends BaseCommand {
                "\n" +
                "am task lock stop: end the current task lock.\n" +
                "\n" +
                "am task resizeable: change if <TASK_ID> is resizeable (true) or not (false).\n" +
                "am task resizeable: change resizeable mode of <TASK_ID>.\n" +
                "   0 (unresizeable) | 1 (crop_windows) | 2 (resizeable) | 3 (resizeable_and_pipable)\n" +
                "\n" +
                "am task resize: makes sure <TASK_ID> is in a stack with the specified bounds.\n" +
                "   Forces the task to be resizeable and creates a stack if no existing stack\n" +
@@ -1985,10 +1986,10 @@ public class Am extends BaseCommand {
        final String taskIdStr = nextArgRequired();
        final int taskId = Integer.valueOf(taskIdStr);
        final String resizeableStr = nextArgRequired();
        final boolean resizeable = Boolean.valueOf(resizeableStr);
        final int resizeableMode = Integer.valueOf(resizeableStr);

        try {
            mAm.setTaskResizeable(taskId, resizeable);
            mAm.setTaskResizeable(taskId, resizeableMode);
        } catch (RemoteException e) {
        }
    }
+5 −5
Original line number Diff line number Diff line
@@ -2587,9 +2587,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM

        case SET_TASK_RESIZEABLE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            int taskId = data.readInt();
            boolean resizeable = (data.readInt() == 1) ? true : false;
            setTaskResizeable(taskId, resizeable);
            final int taskId = data.readInt();
            final int resizeableMode = data.readInt();
            setTaskResizeable(taskId, resizeableMode);
            reply.writeNoException();
            return true;
        }
@@ -6307,12 +6307,12 @@ class ActivityManagerProxy implements IActivityManager
    }

    @Override
    public void setTaskResizeable(int taskId, boolean resizeable) throws  RemoteException {
    public void setTaskResizeable(int taskId, int resizeableMode) throws  RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeInt(taskId);
        data.writeInt(resizeable ? 1 : 0);
        data.writeInt(resizeableMode);
        mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
+1 −1
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ public interface IActivityManager extends IInterface {

    public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
            throws RemoteException;
    public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException;
    public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException;
    public void resizeTask(int taskId, Rect bounds, int resizeMode) throws RemoteException;

    public Rect getTaskBounds(int taskId) throws RemoteException;
+6 −1
Original line number Diff line number Diff line
@@ -785,7 +785,12 @@ public class ActivityInfo extends ComponentInfo
    }

    /** @hide */
    public static final String resizeModeToString(int mode) {
    public static boolean isResizeableMode(int mode) {
        return mode == RESIZE_MODE_RESIZEABLE || mode == RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
    }

    /** @hide */
    public static String resizeModeToString(int mode) {
        switch (mode) {
            case RESIZE_MODE_UNRESIZEABLE:
                return "RESIZE_MODE_UNRESIZEABLE";
+8 −5
Original line number Diff line number Diff line
@@ -101,15 +101,16 @@ interface IWindowManager
     * @param taskBounds Bounds to use when creating a new Task with the input task Id if
     *                   the task doesn't exist yet.
     * @param configuration Configuration that is being used with this task.
     * @param cropWindowsToStack True if the app windows should be cropped to the stack bounds.
     * @param taskResizeMode The resize mode of the task.
     * @param alwaysFocusable True if the app windows are always focusable regardless of the stack
     *                        they are in.
     * @param homeTask True if this is the task.
     */
    void addAppToken(int addPos, IApplicationToken token, int taskId, int stackId,
            int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId,
            int configChanges, boolean voiceInteraction, boolean launchTaskBehind,
            in Rect taskBounds, in Configuration configuration, boolean cropWindowsToStack,
            boolean alwaysFocusable);
            in Rect taskBounds, in Configuration configuration, int taskResizeMode,
            boolean alwaysFocusable, boolean homeTask);
    /**
     *
     * @param token The token we are adding to the input task Id.
@@ -119,9 +120,11 @@ interface IWindowManager
     * @param taskBounds Bounds to use when creating a new Task with the input task Id if
     *                   the task doesn't exist yet.
     * @param config Configuration that is being used with this task.
     * @param taskResizeMode The resize mode of the task.
     * @param homeTask True if this is the task.
     */
    void setAppTask(
            IBinder token, int taskId, int stackId, in Rect taskBounds, in Configuration config);
    void setAppTask(IBinder token, int taskId, int stackId, in Rect taskBounds,
            in Configuration config, int taskResizeMode, boolean homeTask);
    void setAppOrientation(IApplicationToken token, int requestedOrientation);
    int getAppOrientation(IApplicationToken token);
    void setFocusedApp(IBinder token, boolean moveFocusNow);
Loading