From 52641bc309ed1a4e767692586b3fb8e3f3031fb0 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 29 Dec 2015 14:28:32 +0100 Subject: [PATCH] Add am command for CTS tests for resizedDockedStack (1/2) Bug: 25015474 Bug: 26311778 Change-Id: Ia2b1f8ffc5c777d8199409041090a0106503c2e4 --- cmds/am/src/com/android/commands/am/Am.java | 24 ++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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");