Loading core/java/android/app/IActivityTaskManager.aidl +10 −1 Original line number Original line Diff line number Diff line Loading @@ -229,7 +229,16 @@ interface IActivityTaskManager { void unregisterTaskStackListener(in ITaskStackListener listener); void unregisterTaskStackListener(in ITaskStackListener listener); void setTaskResizeable(int taskId, int resizeableMode); void setTaskResizeable(int taskId, int resizeableMode); void toggleFreeformWindowingMode(in IBinder token); void toggleFreeformWindowingMode(in IBinder token); void resizeTask(int taskId, in Rect bounds, int resizeMode); /** * Resize the task with given bounds * * @param taskId The id of the task to set the bounds for. * @param bounds The new bounds. * @param resizeMode Resize mode defined as {@code ActivityTaskManager#RESIZE_MODE_*} constants. * @return Return true on success. Otherwise false. */ boolean resizeTask(int taskId, in Rect bounds, int resizeMode); void moveStackToDisplay(int stackId, int displayId); void moveStackToDisplay(int stackId, int displayId); void removeStack(int stackId); void removeStack(int stackId); Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -3319,7 +3319,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override @Override public void resizeTask(int taskId, Rect bounds, int resizeMode) { public boolean resizeTask(int taskId, Rect bounds, int resizeMode) { mAmInternal.enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "resizeTask()"); mAmInternal.enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "resizeTask()"); long ident = Binder.clearCallingIdentity(); long ident = Binder.clearCallingIdentity(); try { try { Loading @@ -3328,10 +3328,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { MATCH_TASK_IN_STACKS_ONLY); MATCH_TASK_IN_STACKS_ONLY); if (task == null) { if (task == null) { Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found"); Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found"); return; return false; } } if (!task.getWindowConfiguration().canResizeTask()) { if (!task.getWindowConfiguration().canResizeTask()) { throw new IllegalArgumentException("resizeTask not allowed on task=" + task); Slog.w(TAG, "resizeTask not allowed on task=" + task); return false; } } // Reparent the task to the right stack if necessary // Reparent the task to the right stack if necessary Loading @@ -3339,7 +3340,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // After reparenting (which only resizes the task to the stack bounds), resize the // After reparenting (which only resizes the task to the stack bounds), resize the // task to the actual bounds provided // task to the actual bounds provided task.resize(bounds, resizeMode, preserveWindow); return task.resize(bounds, resizeMode, preserveWindow); } } } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); Loading Loading
core/java/android/app/IActivityTaskManager.aidl +10 −1 Original line number Original line Diff line number Diff line Loading @@ -229,7 +229,16 @@ interface IActivityTaskManager { void unregisterTaskStackListener(in ITaskStackListener listener); void unregisterTaskStackListener(in ITaskStackListener listener); void setTaskResizeable(int taskId, int resizeableMode); void setTaskResizeable(int taskId, int resizeableMode); void toggleFreeformWindowingMode(in IBinder token); void toggleFreeformWindowingMode(in IBinder token); void resizeTask(int taskId, in Rect bounds, int resizeMode); /** * Resize the task with given bounds * * @param taskId The id of the task to set the bounds for. * @param bounds The new bounds. * @param resizeMode Resize mode defined as {@code ActivityTaskManager#RESIZE_MODE_*} constants. * @return Return true on success. Otherwise false. */ boolean resizeTask(int taskId, in Rect bounds, int resizeMode); void moveStackToDisplay(int stackId, int displayId); void moveStackToDisplay(int stackId, int displayId); void removeStack(int stackId); void removeStack(int stackId); Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -3319,7 +3319,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override @Override public void resizeTask(int taskId, Rect bounds, int resizeMode) { public boolean resizeTask(int taskId, Rect bounds, int resizeMode) { mAmInternal.enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "resizeTask()"); mAmInternal.enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "resizeTask()"); long ident = Binder.clearCallingIdentity(); long ident = Binder.clearCallingIdentity(); try { try { Loading @@ -3328,10 +3328,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { MATCH_TASK_IN_STACKS_ONLY); MATCH_TASK_IN_STACKS_ONLY); if (task == null) { if (task == null) { Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found"); Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found"); return; return false; } } if (!task.getWindowConfiguration().canResizeTask()) { if (!task.getWindowConfiguration().canResizeTask()) { throw new IllegalArgumentException("resizeTask not allowed on task=" + task); Slog.w(TAG, "resizeTask not allowed on task=" + task); return false; } } // Reparent the task to the right stack if necessary // Reparent the task to the right stack if necessary Loading @@ -3339,7 +3340,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { // After reparenting (which only resizes the task to the stack bounds), resize the // After reparenting (which only resizes the task to the stack bounds), resize the // task to the actual bounds provided // task to the actual bounds provided task.resize(bounds, resizeMode, preserveWindow); return task.resize(bounds, resizeMode, preserveWindow); } } } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); Loading