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

Commit 030979c1 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Don't play animation when docking stack with affordance

Change-Id: I1bb8ae4047e3de3a4ea159e7fad718914b9b5ba7
parent 27777dcb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -751,7 +751,8 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            int taskId = data.readInt();
            int createMode = data.readInt();
            boolean toTop = data.readInt() != 0;
            moveTaskToDockedStack(taskId, createMode, toTop);
            boolean animate = data.readInt() != 0;
            moveTaskToDockedStack(taskId, createMode, toTop, animate);
            reply.writeNoException();
            return true;
        }
@@ -3577,7 +3578,7 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
    }
    @Override
    public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop)
    public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate)
            throws RemoteException
    {
        Parcel data = Parcel.obtain();
@@ -3586,6 +3587,7 @@ class ActivityManagerProxy implements IActivityManager
        data.writeInt(taskId);
        data.writeInt(createMode);
        data.writeInt(toTop ? 1 : 0);
        data.writeInt(animate ? 1 : 0);
        mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ public interface IActivityManager extends IInterface {
    public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException;
    public void moveTaskBackwards(int task) throws RemoteException;
    public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException;
    public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop)
    public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate)
            throws RemoteException;
    public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException;
    public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode) throws RemoteException;
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.util.MutableBoolean;
import android.view.AppTransitionAnimationSpec;
import android.view.LayoutInflater;
import android.view.View;

import com.android.internal.logging.MetricsLogger;
import com.android.systemui.Prefs;
import com.android.systemui.R;
@@ -539,7 +540,7 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub implements
        SystemServicesProxy ssp = Recents.getSystemServices();
        ActivityManager.RunningTaskInfo topTask = ssp.getTopMostTask();
        if (topTask != null && !SystemServicesProxy.isHomeStack(topTask.stackId)) {
            ssp.startTaskInDockedMode(topTask.id,
            ssp.moveTaskToDockedStack(topTask.id,
                    ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT);
            showRecents(false /* triggeredFromAltTab */, draggingInRecents);
        }
+11 −0
Original line number Diff line number Diff line
@@ -311,6 +311,17 @@ public class SystemServicesProxy {
        }
    }

    /** Docks an already resumed task to the side of the screen. */
    public void moveTaskToDockedStack(int taskId, int createMode) {
        if (mIam == null) return;

        try {
            mIam.moveTaskToDockedStack(taskId, createMode, true /* onTop */, false /* animate */);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

    /** Returns the focused stack id. */
    public int getFocusedStack() {
        if (mIam == null) return -1;
+8 −5
Original line number Diff line number Diff line
@@ -4320,7 +4320,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                }
                if (task.stack.mStackId != launchStackId) {
                    mStackSupervisor.moveTaskToStackLocked(
                            taskId, launchStackId, ON_TOP, FORCE_FOCUS, "startActivityFromRecents");
                            taskId, launchStackId, ON_TOP, FORCE_FOCUS, "startActivityFromRecents",
                            true /* animate */);
                }
            }
@@ -9239,7 +9240,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                if (DEBUG_STACK) Slog.d(TAG_STACK, "moveActivityToStack: moving r=" + r
                        + " to stackId=" + stackId);
                mStackSupervisor.moveTaskToStackLocked(r.task.taskId, stackId, ON_TOP, !FORCE_FOCUS,
                        "moveActivityToStack");
                        "moveActivityToStack", true /* animate */);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
@@ -9260,7 +9261,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToStack: moving task=" + taskId
                        + " to stackId=" + stackId + " toTop=" + toTop);
                mStackSupervisor.moveTaskToStackLocked(taskId, stackId, toTop, !FORCE_FOCUS,
                        "moveTaskToStack");
                        "moveTaskToStack", true /* animate */);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
@@ -9277,9 +9278,10 @@ public final class ActivityManagerService extends ActivityManagerNative
     *                   and
     *                   {@link android.app.ActivityManager#DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT}
     * @param toTop If the task and stack should be moved to the top.
     * @param animate Whether we should play an animation for the moving the task
     */
    @Override
    public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop) {
    public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate) {
        enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS,
                "moveTaskToDockedStack()");
        synchronized (this) {
@@ -9289,7 +9291,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                        + " to createMode=" + createMode + " toTop=" + toTop);
                mWindowManager.setDockedStackCreateMode(createMode);
                mStackSupervisor.moveTaskToStackLocked(
                        taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, "moveTaskToDockedStack");
                        taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, "moveTaskToDockedStack",
                        animate);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
Loading