Loading core/java/android/app/ActivityManagerNative.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -792,8 +792,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM if (hasBounds) { if (hasBounds) { bounds = Rect.CREATOR.createFromParcel(data); bounds = Rect.CREATOR.createFromParcel(data); } } moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); boolean res = moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); reply.writeNoException(); reply.writeNoException(); reply.writeInt(res ? 1 : 0); return true; return true; } } Loading Loading @@ -3809,7 +3810,7 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); reply.recycle(); } } @Override @Override public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) throws RemoteException Rect initialBounds) throws RemoteException { { Parcel data = Parcel.obtain(); Parcel data = Parcel.obtain(); Loading @@ -3827,8 +3828,10 @@ class ActivityManagerProxy implements IActivityManager } } mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); reply.readException(); reply.readException(); boolean res = reply.readInt() > 0; data.recycle(); data.recycle(); reply.recycle(); reply.recycle(); return res; } } @Override @Override public boolean moveTopActivityToPinnedStack(int stackId, Rect r) public boolean moveTopActivityToPinnedStack(int stackId, Rect r) Loading core/java/android/app/IActivityManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -143,7 +143,7 @@ public interface IActivityManager extends IInterface { public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException; public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException; public void moveTaskBackwards(int task) throws RemoteException; public void moveTaskBackwards(int task) throws RemoteException; public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException; public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException; public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) throws RemoteException; Rect initialBounds) throws RemoteException; public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException; public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException; public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +8 −5 Original line number Original line Diff line number Diff line Loading @@ -568,12 +568,15 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Make sure we inform DividerView before we actually start the activity so we can change // Make sure we inform DividerView before we actually start the activity so we can change // the resize mode already. // the resize mode already. if (ssp.moveTaskToDockedStack(topTaskId, stackCreateMode, initialBounds)) { EventBus.getDefault().send(new DockingTopTaskEvent(dragMode)); EventBus.getDefault().send(new DockingTopTaskEvent(dragMode)); ssp.moveTaskToDockedStack(topTaskId, stackCreateMode, initialBounds); showRecents( showRecents(false /* triggeredFromAltTab */, false /* triggeredFromAltTab */, dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false /* animate */, dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false /* animate */, true /* reloadTasks*/); true /* reloadTasks*/); } } } /** /** * Returns the preloaded load plan and invalidates it. * Returns the preloaded load plan and invalidates it. Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -338,15 +338,18 @@ public class SystemServicesProxy { } } /** Docks an already resumed task to the side of the screen. */ /** Docks an already resumed task to the side of the screen. */ public void moveTaskToDockedStack(int taskId, int createMode, Rect initialBounds) { public boolean moveTaskToDockedStack(int taskId, int createMode, Rect initialBounds) { if (mIam == null) return; if (mIam == null) { return false; } try { try { mIam.moveTaskToDockedStack(taskId, createMode, true /* onTop */, false /* animate */, return mIam.moveTaskToDockedStack( initialBounds); taskId, createMode, true /* onTop */, false /* animate */, initialBounds); } catch (RemoteException e) { } catch (RemoteException e) { e.printStackTrace(); e.printStackTrace(); } } return false; } } /** Returns the focused stack id. */ /** Returns the focused stack id. */ Loading services/core/java/com/android/server/am/ActivityManagerService.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -9493,7 +9493,7 @@ public final class ActivityManagerService extends ActivityManagerNative * docked stack. Pass {@code null} to use default bounds. * docked stack. Pass {@code null} to use default bounds. */ */ @Override @Override public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) { Rect initialBounds) { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()"); enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()"); synchronized (this) { synchronized (this) { Loading @@ -9502,7 +9502,8 @@ public final class ActivityManagerService extends ActivityManagerNative if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToDockedStack: moving task=" + taskId if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToDockedStack: moving task=" + taskId + " to createMode=" + createMode + " toTop=" + toTop); + " to createMode=" + createMode + " toTop=" + toTop); mWindowManager.setDockedStackCreateState(createMode, initialBounds); mWindowManager.setDockedStackCreateState(createMode, initialBounds); mStackSupervisor.moveTaskToStackLocked(taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, return mStackSupervisor.moveTaskToStackLocked( taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, "moveTaskToDockedStack", animate); "moveTaskToDockedStack", animate); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); Loading Loading
core/java/android/app/ActivityManagerNative.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -792,8 +792,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM if (hasBounds) { if (hasBounds) { bounds = Rect.CREATOR.createFromParcel(data); bounds = Rect.CREATOR.createFromParcel(data); } } moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); boolean res = moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); reply.writeNoException(); reply.writeNoException(); reply.writeInt(res ? 1 : 0); return true; return true; } } Loading Loading @@ -3809,7 +3810,7 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); reply.recycle(); } } @Override @Override public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) throws RemoteException Rect initialBounds) throws RemoteException { { Parcel data = Parcel.obtain(); Parcel data = Parcel.obtain(); Loading @@ -3827,8 +3828,10 @@ class ActivityManagerProxy implements IActivityManager } } mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); reply.readException(); reply.readException(); boolean res = reply.readInt() > 0; data.recycle(); data.recycle(); reply.recycle(); reply.recycle(); return res; } } @Override @Override public boolean moveTopActivityToPinnedStack(int stackId, Rect r) public boolean moveTopActivityToPinnedStack(int stackId, Rect r) Loading
core/java/android/app/IActivityManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -143,7 +143,7 @@ public interface IActivityManager extends IInterface { public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException; public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException; public void moveTaskBackwards(int task) throws RemoteException; public void moveTaskBackwards(int task) throws RemoteException; public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException; public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException; public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) throws RemoteException; Rect initialBounds) throws RemoteException; public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException; public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException; public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +8 −5 Original line number Original line Diff line number Diff line Loading @@ -568,12 +568,15 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Make sure we inform DividerView before we actually start the activity so we can change // Make sure we inform DividerView before we actually start the activity so we can change // the resize mode already. // the resize mode already. if (ssp.moveTaskToDockedStack(topTaskId, stackCreateMode, initialBounds)) { EventBus.getDefault().send(new DockingTopTaskEvent(dragMode)); EventBus.getDefault().send(new DockingTopTaskEvent(dragMode)); ssp.moveTaskToDockedStack(topTaskId, stackCreateMode, initialBounds); showRecents( showRecents(false /* triggeredFromAltTab */, false /* triggeredFromAltTab */, dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false /* animate */, dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false /* animate */, true /* reloadTasks*/); true /* reloadTasks*/); } } } /** /** * Returns the preloaded load plan and invalidates it. * Returns the preloaded load plan and invalidates it. Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -338,15 +338,18 @@ public class SystemServicesProxy { } } /** Docks an already resumed task to the side of the screen. */ /** Docks an already resumed task to the side of the screen. */ public void moveTaskToDockedStack(int taskId, int createMode, Rect initialBounds) { public boolean moveTaskToDockedStack(int taskId, int createMode, Rect initialBounds) { if (mIam == null) return; if (mIam == null) { return false; } try { try { mIam.moveTaskToDockedStack(taskId, createMode, true /* onTop */, false /* animate */, return mIam.moveTaskToDockedStack( initialBounds); taskId, createMode, true /* onTop */, false /* animate */, initialBounds); } catch (RemoteException e) { } catch (RemoteException e) { e.printStackTrace(); e.printStackTrace(); } } return false; } } /** Returns the focused stack id. */ /** Returns the focused stack id. */ Loading
services/core/java/com/android/server/am/ActivityManagerService.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -9493,7 +9493,7 @@ public final class ActivityManagerService extends ActivityManagerNative * docked stack. Pass {@code null} to use default bounds. * docked stack. Pass {@code null} to use default bounds. */ */ @Override @Override public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) { Rect initialBounds) { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()"); enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()"); synchronized (this) { synchronized (this) { Loading @@ -9502,7 +9502,8 @@ public final class ActivityManagerService extends ActivityManagerNative if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToDockedStack: moving task=" + taskId if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToDockedStack: moving task=" + taskId + " to createMode=" + createMode + " toTop=" + toTop); + " to createMode=" + createMode + " toTop=" + toTop); mWindowManager.setDockedStackCreateState(createMode, initialBounds); mWindowManager.setDockedStackCreateState(createMode, initialBounds); mStackSupervisor.moveTaskToStackLocked(taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, return mStackSupervisor.moveTaskToStackLocked( taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, "moveTaskToDockedStack", animate); "moveTaskToDockedStack", animate); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); Loading