diff options
author | Anthony Newnam <anthony.newnam@garmin.com> | 2010-04-14 14:34:41 -0500 |
---|---|---|
committer | Garmin Android technology group <android@garmin.com> | 2010-04-14 14:35:11 -0500 |
commit | d4dd85d532dcd383a2f6b421e747b5ab07246d19 (patch) | |
tree | 2bcf1bde78fe3c0f2c470da8779653512539dc7a /cmds/am | |
parent | 69e398bd14fc909bb5f854c435fd210ae0974748 (diff) | |
download | frameworks_base-d4dd85d532dcd383a2f6b421e747b5ab07246d19.zip frameworks_base-d4dd85d532dcd383a2f6b421e747b5ab07246d19.tar.gz frameworks_base-d4dd85d532dcd383a2f6b421e747b5ab07246d19.tar.bz2 |
Allow Am to start services
Change-Id: I31d066ae2c980cc293e55034446a63a0f42088ad
Diffstat (limited to 'cmds/am')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index eca5af9..3566caf 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -88,6 +88,8 @@ public class Am { if (op.equals("start")) { runStart(); + } else if (op.equals("start-service")) { + runStartService(); } else if (op.equals("instrument")) { runInstrument(); } else if (op.equals("broadcast")) { @@ -238,6 +240,19 @@ public class Am { } } + private void runStartService() throws Exception { + Intent intent = makeIntent(); + + if (intent != null) { + System.out.println("Starting: " + intent); + try { + mAm.startService(null, intent, intent.getType()); + } catch (Exception e) { + System.err.println("Error: " + e); + } + } + } + private void sendBroadcast() throws Exception { Intent intent = makeIntent(); IntentReceiver receiver = new IntentReceiver(); |