diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-05-19 18:37:45 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2009-05-19 18:46:53 -0700 |
commit | 95fc68f24a2a93e5664e2234abcfe479d385cc05 (patch) | |
tree | 6f8f8071cf8a69d82fd16c1d5455ea81d31e1275 /cmds/am | |
parent | ee748d37b01b3affb72b701d95ba20c189887b5f (diff) | |
download | frameworks_base-95fc68f24a2a93e5664e2234abcfe479d385cc05.zip frameworks_base-95fc68f24a2a93e5664e2234abcfe479d385cc05.tar.gz frameworks_base-95fc68f24a2a93e5664e2234abcfe479d385cc05.tar.bz2 |
Fix issue where apps could prevent the user from going home.
Now we have a 5-second time after home is pressed, during which
only the home app (and the status bar) can switch to another app.
After that time, any start activity requests that occurred will
be executed, to allow things like alarms to be displayed. Also
if during that time the user launches another app, the pending
starts will be executed without resuming their activities and
the one they started placed at the top and executed.
Diffstat (limited to 'cmds/am')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 6d4b455..88ad265 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -194,18 +194,17 @@ public class Am { if (intent != null) { System.out.println("Starting: " + intent); try { - intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // XXX should do something to determine the MIME type. int res = mAm.startActivity(null, intent, intent.getType(), null, 0, null, null, 0, false, mDebugOption); switch (res) { case IActivityManager.START_SUCCESS: break; - case IActivityManager.START_CLASS_NOT_FOUND: - System.err.println("Error type 3"); - System.err.println("Error: Activity class " + - intent.getComponent().toShortString() - + " does not exist."); + case IActivityManager.START_SWITCHES_CANCELED: + System.err.println( + "Warning: Activity not started because the " + + " current activity is being kept for the user."); break; case IActivityManager.START_DELIVERED_TO_TOP: System.err.println( @@ -213,25 +212,36 @@ public class Am { + "been delivered to currently running " + "top-most instance."); break; - case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT: + case IActivityManager.START_RETURN_INTENT_TO_CALLER: System.err.println( - "Error: Activity not started, you requested to " - + "both forward and receive its result"); + "Warning: Activity not started because intent " + + "should be handled by the caller"); + break; + case IActivityManager.START_TASK_TO_FRONT: + System.err.println( + "Warning: Activity not started, its current " + + "task has been brought to the front"); break; case IActivityManager.START_INTENT_NOT_RESOLVED: System.err.println( "Error: Activity not started, unable to " + "resolve " + intent.toString()); break; - case IActivityManager.START_RETURN_INTENT_TO_CALLER: + case IActivityManager.START_CLASS_NOT_FOUND: + System.err.println("Error type 3"); + System.err.println("Error: Activity class " + + intent.getComponent().toShortString() + + " does not exist."); + break; + case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT: System.err.println( - "Warning: Activity not started because intent " - + "should be handled by the caller"); + "Error: Activity not started, you requested to " + + "both forward and receive its result"); break; - case IActivityManager.START_TASK_TO_FRONT: + case IActivityManager.START_PERMISSION_DENIED: System.err.println( - "Warning: Activity not started, its current " - + "task has been brought to the front"); + "Error: Activity not started, you do not " + + "have permission to access it."); break; default: System.err.println( |