File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
cmds/am/src/com/android/commands/am Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ private void run(String[] args) throws Exception {
8888
8989 if (op .equals ("start" )) {
9090 runStart ();
91+ } else if (op .equals ("start-service" )) {
92+ runStartService ();
9193 } else if (op .equals ("instrument" )) {
9294 runInstrument ();
9395 } else if (op .equals ("broadcast" )) {
@@ -238,6 +240,19 @@ private void runStart() throws Exception {
238240 }
239241 }
240242
243+ private void runStartService () throws Exception {
244+ Intent intent = makeIntent ();
245+
246+ if (intent != null ) {
247+ System .out .println ("Starting: " + intent );
248+ try {
249+ mAm .startService (null , intent , intent .getType ());
250+ } catch (Exception e ) {
251+ System .err .println ("Error: " + e );
252+ }
253+ }
254+ }
255+
241256 private void sendBroadcast () throws Exception {
242257 Intent intent = makeIntent ();
243258 IntentReceiver receiver = new IntentReceiver ();
You can’t perform that action at this time.
0 commit comments