summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-02-01 16:49:44 -0800
committerWale Ogunwale <ogunwale@google.com>2015-02-02 16:06:55 -0800
commit9d3de4cfb42519fefe9d8b03c38ba440bd6bc886 (patch)
treeb0510ec8967a1cab6e6d179c37c6e647bb5db9e5 /cmds/am
parent547c9e5212cabc14efcd495935970ae98914a207 (diff)
downloadframeworks_base-9d3de4cfb42519fefe9d8b03c38ba440bd6bc886.zip
frameworks_base-9d3de4cfb42519fefe9d8b03c38ba440bd6bc886.tar.gz
frameworks_base-9d3de4cfb42519fefe9d8b03c38ba440bd6bc886.tar.bz2
Support for activity to opt-in/out of resizeable/multi-window support.
Bug: 19178148 Change-Id: I5819a71cdc48e0af4add11a6d4a503ec5cbe5d63
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java41
1 files changed, 35 insertions, 6 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index fb3d423..cf608a8 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -134,8 +134,9 @@ public class Am extends BaseCommand {
" am stack resize <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" +
" am stack list\n" +
" am stack info <STACK_ID>\n" +
- " am lock-task <TASK_ID>\n" +
- " am lock-task stop\n" +
+ " am task lock <TASK_ID>\n" +
+ " am task lock stop\n" +
+ " am task resizeable <TASK_ID> [true|false]\n" +
" am get-config\n" +
"\n" +
"am start: start an Activity. Options are:\n" +
@@ -250,7 +251,11 @@ public class Am extends BaseCommand {
"\n" +
"am stack info: display the information about activity stack <STACK_ID>.\n" +
"\n" +
- "am lock-task: bring <TASK_ID> to the front and don't allow other tasks to run\n" +
+ "am task lock: bring <TASK_ID> to the front and don't allow other tasks to run\n" +
+ "\n" +
+ "am task lock stop: end the current task lock\n" +
+ "\n" +
+ "am task resizeable: change if <TASK_ID> is resizeable (true) or not (false).\n" +
"\n" +
"am get-config: retrieve the configuration and any recent configurations\n" +
" of the device\n" +
@@ -351,8 +356,8 @@ public class Am extends BaseCommand {
runStopUser();
} else if (op.equals("stack")) {
runStack();
- } else if (op.equals("lock-task")) {
- runLockTask();
+ } else if (op.equals("task")) {
+ runTask();
} else if (op.equals("get-config")) {
runGetConfig();
} else {
@@ -1778,7 +1783,19 @@ public class Am extends BaseCommand {
}
}
- private void runLockTask() throws Exception {
+ private void runTask() throws Exception {
+ String op = nextArgRequired();
+ if (op.equals("lock")) {
+ runTaskLock();
+ } else if (op.equals("resizeable")) {
+ runTaskResizeable();
+ } else {
+ showError("Error: unknown command '" + op + "'");
+ return;
+ }
+ }
+
+ private void runTaskLock() throws Exception {
String taskIdStr = nextArgRequired();
try {
if (taskIdStr.equals("stop")) {
@@ -1793,6 +1810,18 @@ public class Am extends BaseCommand {
}
}
+ private void runTaskResizeable() throws Exception {
+ final String taskIdStr = nextArgRequired();
+ final int taskId = Integer.valueOf(taskIdStr);
+ final String resizeableStr = nextArgRequired();
+ final boolean resizeable = Boolean.valueOf(resizeableStr);
+
+ try {
+ mAm.setTaskResizeable(taskId, resizeable);
+ } catch (RemoteException e) {
+ }
+ }
+
private List<Configuration> getRecentConfigurations(int days) {
IUsageStatsManager usm = IUsageStatsManager.Stub.asInterface(ServiceManager.getService(
Context.USAGE_STATS_SERVICE));