From c0bd747b0605af251ff136277f14220a5a4c9818 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 9 Oct 2012 14:00:30 -0700 Subject: Further work on issue #7307399: Framework needs a new pre-user-shutdown... ...phase & callback API I realized there were a few things wrong with what was there. The new ACTION_USER_STARTING was not being sent for the first user at boot, and there was an existing problem where ACTION_USER_STARTED was sent every time there was a user switch. Also improved some debug output of broadcasts to make it easier to see what is going on in this stuff, and better reporting of why a service couldn't be started. Change-Id: Id8a536defbbad1f73d94a37d13762436b822fbe3 --- cmds/am/src/com/android/commands/am/Am.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmds/am/src/com/android/commands') diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 3df88bb..add7a23 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -415,6 +415,10 @@ public class Am { ComponentName cn = mAm.startService(null, intent, intent.getType(), mUserId); if (cn == null) { System.err.println("Error: Not found; no service started."); + } else if (cn.getPackageName().equals("!")) { + System.err.println("Error: Requires permission " + cn.getClassName()); + } else if (cn.getPackageName().equals("!!")) { + System.err.println("Error: " + cn.getClassName()); } } -- cgit v1.1