diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 4f7a1095cfbea..6302d7418cd0c 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -159,6 +159,7 @@ public class Am extends BaseCommand { " am stack start \n" + " am stack movetask [true|false]\n" + " am stack resize \n" + + " am stack resize-docked-stack []\n" + " am stack size-docked-stack-test: [DELAY_MS]\n" + " am stack move-top-activity-to-pinned-stack: \n" + " am stack positiontask \n" + @@ -299,7 +300,11 @@ public class Am extends BaseCommand { "am stack movetask: move from its current stack to the top (true) or" + " bottom (false) of .\n" + "\n" + - "am stack resize: change size and position to ." + + "am stack resize: change size and position to .\n" + + "\n" + + "am stack resize-docked-stack: change docked stack to \n" + + " and supplying temporary different task bounds indicated by\n" + + " \n" + "\n" + "am stack size-docked-stack-test: test command for sizing docked stack by\n" + " increments from the side eft, op, ight, or ottom\n" + @@ -1683,6 +1688,9 @@ public class Am extends BaseCommand { case "resize": runStackResize(); break; + case "resize-docked-stack": + runStackResizeDocked(); + break; case "positiontask": runStackPositionTask(); break; @@ -1751,6 +1759,20 @@ public class Am extends BaseCommand { resizeStack(stackId, bounds, 0); } + private void runStackResizeDocked() throws Exception { + final Rect bounds = getBounds(); + final Rect taskBounds = getBounds(); + if (bounds == null || taskBounds == null) { + System.err.println("Error: invalid input bounds"); + return; + } + try { + mAm.resizeDockedStack(bounds, taskBounds, null, null, null); + } catch (RemoteException e) { + showError("Error: resizing docked stack " + e); + } + } + private void resizeStack(int stackId, Rect bounds, int delayMs) throws Exception { if (bounds == null) { showError("Error: invalid input bounds");