diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-03-26 17:17:25 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-03-26 17:17:25 -0700 |
commit | 5ef402baafc4818ccdf2aaec5da9cf25dd1c0e12 (patch) | |
tree | 6678df993ee5d0af105bcb948472d747fd27059d /cmds | |
parent | 9c3cee9824026764275e4d84ba9b5d9fdc5da690 (diff) | |
download | frameworks_base-5ef402baafc4818ccdf2aaec5da9cf25dd1c0e12.zip frameworks_base-5ef402baafc4818ccdf2aaec5da9cf25dd1c0e12.tar.gz frameworks_base-5ef402baafc4818ccdf2aaec5da9cf25dd1c0e12.tar.bz2 |
Fix issue #2538228: Intents targeting browsers constantly nagging
Some applications are setting the MIME type field for an http:
intent, which is technically wrong because the recipient opening
the URI will get the MIME type from the header. This was hitting
a bug when we compute the intent filter when setting the
preferred activity, where we have to set both the MIME type and
data URI for the intent filter. (For file: and content: URIs
only the MIME type is needed, since these can be opened directly
through ContentResolver so everyone is presumed to be able to
handle them.)
Change-Id: Ia7025e6859e9c90997bf56c2c80f225fca7a2007
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 5d6970a..736ac08 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -154,6 +154,42 @@ public class Am { } else if (opt.equals("-f")) { String str = nextArgRequired(); intent.setFlags(Integer.decode(str).intValue()); + } else if (opt.equals("--grant-read-uri-permission")) { + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + } else if (opt.equals("--grant-write-uri-permission")) { + intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); + } else if (opt.equals("--debug-log-resolution")) { + intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION); + } else if (opt.equals("--activity-brought-to-front")) { + intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); + } else if (opt.equals("--activity-clear-top")) { + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + } else if (opt.equals("--activity-clear-when-task-reset")) { + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); + } else if (opt.equals("--activity-exclude-from-recents")) { + intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); + } else if (opt.equals("--activity-launched-from-history")) { + intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY); + } else if (opt.equals("--activity-multiple-task")) { + intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); + } else if (opt.equals("--activity-no-animation")) { + intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); + } else if (opt.equals("--activity-no-history")) { + intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); + } else if (opt.equals("--activity-no-user-action")) { + intent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION); + } else if (opt.equals("--activity-previous-is-top")) { + intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); + } else if (opt.equals("--activity-reorder-to-front")) { + intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); + } else if (opt.equals("--activity-reset-task-if-needed")) { + intent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + } else if (opt.equals("--activity-single-top")) { + intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); + } else if (opt.equals("--receiver-registered-only")) { + intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); + } else if (opt.equals("--receiver-replace-pending")) { + intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); } else if (opt.equals("-D")) { mDebugOption = true; } else if (opt.equals("-W")) { @@ -565,7 +601,18 @@ public class Am { " [--esn <EXTRA_KEY> ...]\n" + " [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]\n" + " [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]\n" + - " [-n <COMPONENT>] [-f <FLAGS>] [<URI>]\n" + " [-n <COMPONENT>] [-f <FLAGS>]\n" + + " [--grant-read-uri-permission] [--grant-write-uri-permission]\n" + + " [--debug-log-resolution]\n" + + " [--activity-brought-to-front] [--activity-clear-top]\n" + + " [--activity-clear-when-task-reset] [--activity-exclude-from-recents]\n" + + " [--activity-launched-from-history] [--activity-multiple-task]\n" + + " [--activity-no-animation] [--activity-no-history]\n" + + " [--activity-no-user-action] [--activity-previous-is-top]\n" + + " [--activity-reorder-to-front] [--activity-reset-task-if-needed]\n" + + " [--activity-single-top]\n" + + " [--receiver-registered-only] [--receiver-replace-pending]\n" + + " [<URI>]\n" ); } } |