Loading core/java/android/app/ActivityManagerNative.java +4 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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(); Loading @@ -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(); Loading core/java/android/app/IActivityManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading services/core/java/com/android/server/am/ActivityManagerService.java +8 −5 Original line number Diff line number Diff line Loading @@ -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 */); } } Loading Loading @@ -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); } Loading @@ -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); } Loading @@ -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) { Loading @@ -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 Loading
core/java/android/app/ActivityManagerNative.java +4 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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(); Loading @@ -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(); Loading
core/java/android/app/IActivityManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
services/core/java/com/android/server/am/ActivityManagerService.java +8 −5 Original line number Diff line number Diff line Loading @@ -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 */); } } Loading Loading @@ -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); } Loading @@ -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); } Loading @@ -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) { Loading @@ -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