diff options
author | Craig Mautner <cmautner@google.com> | 2013-12-16 16:14:02 -0800 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2014-01-06 08:51:21 -0800 |
commit | e0a3884cb627efc650e19fbe76b1b3343468cf57 (patch) | |
tree | 5cdfc0e202bb18c314138dea3f1328c3f6e55ba0 /cmds | |
parent | 02d5df1066c07972e1169a338e5fba16c86cc51b (diff) | |
download | frameworks_base-e0a3884cb627efc650e19fbe76b1b3343468cf57.zip frameworks_base-e0a3884cb627efc650e19fbe76b1b3343468cf57.tar.gz frameworks_base-e0a3884cb627efc650e19fbe76b1b3343468cf57.tar.bz2 |
Extend stack management to other displays.
- Abandon ActivityContainer.startActivity() in favor of
IActivityManager.startActivityAsUserInContainer().
- Modify Am to test starting an activity on a container.
- Create a DisplayContext as the base context if the activity token
is on a different display.
- Test for home display in more cases when manipulating home stack.
- Rename mDisplayInfos => mActivityDisplays.
- Create new method for moving task to front of stack regardless of
which display it is on.
Change-Id: I4fcb83ae844c5839ee3e2722229623d1a80ed921
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 7adf5ec..89e15d2 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -109,7 +109,7 @@ public class Am extends BaseCommand { " am to-intent-uri [INTENT]\n" + " am switch-user <USER_ID>\n" + " am stop-user <USER_ID>\n" + - " am stack create <TASK_ID> <DISPLAY_ID>\n" + + " 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 list\n" + @@ -207,7 +207,7 @@ public class Am extends BaseCommand { "am stop-user: stop execution of USER_ID, not allowing it to run any\n" + " code until a later explicit switch to it.\n" + "\n" + - "am stack create: create a new stack containing <TASK_ID> which must exist\n" + + "am stack start: start a new activity on <DISPLAY_ID> using <INTENT>.\n" + "\n" + "am stack movetask: move <TASK_ID> from its current stack to the top (true) or" + " bottom (false) of <STACK_ID>.\n" + @@ -1541,8 +1541,8 @@ public class Am extends BaseCommand { private void runStack() throws Exception { String op = nextArgRequired(); - if (op.equals("create")) { - runStackCreate(); + if (op.equals("start")) { + runStackStart(); } else if (op.equals("movetask")) { runStackMoveTask(); } else if (op.equals("resize")) { @@ -1557,19 +1557,16 @@ public class Am extends BaseCommand { } } - private void runStackCreate() throws Exception { - String taskIdStr = nextArgRequired(); - int taskId = Integer.valueOf(taskIdStr); + private void runStackStart() throws Exception { String displayIdStr = nextArgRequired(); int displayId = Integer.valueOf(displayIdStr); + Intent intent = makeIntent(UserHandle.USER_CURRENT); try { IBinder homeActivityToken = mAm.getHomeActivityToken(); IActivityContainer container = mAm.createActivityContainer(homeActivityToken, null); - final int stackId = container.getStackId(); - System.out.println("createStack returned new stackId=" + stackId + "\n"); container.attachToDisplay(displayId); - mAm.moveTaskToStack(taskId, stackId, true); + container.startActivity(intent); } catch (RemoteException e) { } } |