summaryrefslogtreecommitdiff
path: root/cmds/am/src
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-12-29 14:28:32 +0100
committerJorim Jaggi <jjaggi@google.com>2016-01-05 13:50:10 +0100
commit52641bc309ed1a4e767692586b3fb8e3f3031fb0 (patch)
treeb09535ebedd66674d1dae9e93a22be550a69ae39 /cmds/am/src
parent6f2efd3d8c114f9a4b472ef699bbd844323cd82c (diff)
Add am command for CTS tests for resizedDockedStack (1/2)
Bug: 25015474 Bug: 26311778 Change-Id: Ia2b1f8ffc5c777d8199409041090a0106503c2e4
Diffstat (limited to 'cmds/am/src')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 4f7a1095cfbe..6302d7418cd0 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 <DISPLAY_ID> <INTENT>\n" +
" am stack movetask <TASK_ID> <STACK_ID> [true|false]\n" +
" am stack resize <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" +
+ " am stack resize-docked-stack <LEFT,TOP,RIGHT,BOTTOM> [<TASK_LEFT,TASK_TOP,TASK_RIGHT,TASK_BOTTOM>]\n" +
" am stack size-docked-stack-test: <STEP_SIZE> <l|t|r|b> [DELAY_MS]\n" +
" am stack move-top-activity-to-pinned-stack: <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" +
" am stack positiontask <TASK_ID> <STACK_ID> <POSITION>\n" +
@@ -299,7 +300,11 @@ public class Am extends BaseCommand {
"am stack movetask: move <TASK_ID> from its current stack to the top (true) or" +
" bottom (false) of <STACK_ID>.\n" +
"\n" +
- "am stack resize: change <STACK_ID> size and position to <LEFT,TOP,RIGHT,BOTTOM>." +
+ "am stack resize: change <STACK_ID> size and position to <LEFT,TOP,RIGHT,BOTTOM>.\n" +
+ "\n" +
+ "am stack resize-docked-stack: change docked stack to <LEFT,TOP,RIGHT,BOTTOM>\n" +
+ " and supplying temporary different task bounds indicated by\n" +
+ " <TASK_LEFT,TOP,RIGHT,BOTTOM>\n" +
"\n" +
"am stack size-docked-stack-test: test command for sizing docked stack by\n" +
" <STEP_SIZE> increments from the side <l>eft, <t>op, <r>ight, or <b>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");