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

Commit 85941cff authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Added support to specify animation duration when resizing stack" into nyc-dev

parents fb811aaf e75a9adf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1814,7 +1814,7 @@ public class Am extends BaseCommand {

    private void resizeStackUnchecked(int stackId, Rect bounds, int delayMs, boolean animate) {
        try {
            mAm.resizeStack(stackId, bounds, false, false, animate);
            mAm.resizeStack(stackId, bounds, false, false, animate, -1);
            Thread.sleep(delayMs);
        } catch (RemoteException e) {
            showError("Error: resizing stack " + e);
+6 −2
Original line number Diff line number Diff line
@@ -820,7 +820,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            final boolean allowResizeInDockedMode = data.readInt() == 1;
            final boolean preserveWindows = data.readInt() == 1;
            final boolean animate = data.readInt() == 1;
            resizeStack(stackId, r, allowResizeInDockedMode, preserveWindows, animate);
            final int animationDuration = data.readInt();
            resizeStack(stackId,
                    r, allowResizeInDockedMode, preserveWindows, animate, animationDuration);
            reply.writeNoException();
            return true;
        }
@@ -3889,7 +3891,8 @@ class ActivityManagerProxy implements IActivityManager
    }
    @Override
    public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode,
            boolean preserveWindows, boolean animate) throws RemoteException {
            boolean preserveWindows, boolean animate, int animationDuration)
            throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
@@ -3903,6 +3906,7 @@ class ActivityManagerProxy implements IActivityManager
        data.writeInt(allowResizeInDockedMode ? 1 : 0);
        data.writeInt(preserveWindows ? 1 : 0);
        data.writeInt(animate ? 1 : 0);
        data.writeInt(animationDuration);
        mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
+16 −1
Original line number Diff line number Diff line
@@ -148,8 +148,23 @@ public interface IActivityManager extends IInterface {
    public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
            Rect initialBounds) throws RemoteException;
    public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException;

    /**
     * Resizes the input stack id to the given bounds.
     *
     * @param stackId Id of the stack to resize.
     * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
     * @param allowResizeInDockedMode True if the resize should be allowed when the docked stack is
     *                                active.
     * @param preserveWindows True if the windows of activities contained in the stack should be
     *                        preserved.
     * @param animate True if the stack resize should be animated.
     * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
     *                          default animation duration should be used.
     * @throws RemoteException
     */
    public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode,
            boolean preserveWindows, boolean animate) throws RemoteException;
            boolean preserveWindows, boolean animate, int animationDuration) throws RemoteException;

    /**
     * Moves all tasks from the docked stack in the fullscreen stack and puts the top task of the
+2 −2
Original line number Diff line number Diff line
@@ -100,8 +100,8 @@ public class WindowManagerProxy {
        @Override
        public void run() {
            try {
                ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true, true,
                        false);
                ActivityManagerNative.getDefault().resizeStack(
                        DOCKED_STACK_ID, null, true, true, false, -1);
            } catch (RemoteException e) {
                Log.w(TAG, "Failed to resize stack: " + e);
            }
+1 −1
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ public class PipManager {
                break;
        }
        try {
            mActivityManager.resizeStack(PINNED_STACK_ID, mCurrentPipBounds, true, true, true);
            mActivityManager.resizeStack(PINNED_STACK_ID, mCurrentPipBounds, true, true, true, -1);
        } catch (RemoteException e) {
            Log.e(TAG, "showPipMenu failed", e);
        }
Loading