diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-03-26 18:06:52 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-26 18:06:52 -0700 |
commit | 4c8a63ca4d4ac18f593fd9c235f18ba1f691eef7 (patch) | |
tree | 5cd50c6c421edd4e4e88d7a025a68f952abe8e59 | |
parent | 5c2a502bffc05d54c8de3456fee5aec5b99ff3e9 (diff) | |
parent | 5ef402baafc4818ccdf2aaec5da9cf25dd1c0e12 (diff) | |
download | frameworks_base-4c8a63ca4d4ac18f593fd9c235f18ba1f691eef7.zip frameworks_base-4c8a63ca4d4ac18f593fd9c235f18ba1f691eef7.tar.gz frameworks_base-4c8a63ca4d4ac18f593fd9c235f18ba1f691eef7.tar.bz2 |
Merge "Fix issue #2538228: Intents targeting browsers constantly nagging" into froyo
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 49 | ||||
-rw-r--r-- | core/java/com/android/internal/app/ResolverActivity.java | 54 |
2 files changed, 79 insertions, 24 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" ); } } diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index 7466cc4..215e9ae 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -133,31 +133,39 @@ public class ResolverActivity extends AlertActivity implements filter = null; } } - } else if (data != null && data.getScheme() != null) { - filter.addDataScheme(data.getScheme()); - - // Look through the resolved filter to determine which part - // of it matched the original Intent. - Iterator<IntentFilter.AuthorityEntry> aIt = ri.filter.authoritiesIterator(); - if (aIt != null) { - while (aIt.hasNext()) { - IntentFilter.AuthorityEntry a = aIt.next(); - if (a.match(data) >= 0) { - int port = a.getPort(); - filter.addDataAuthority(a.getHost(), - port >= 0 ? Integer.toString(port) : null); - break; + } + if (data != null && data.getScheme() != null) { + // We need the data specification if there was no type, + // OR if the scheme is not one of our magical "file:" + // or "content:" schemes (see IntentFilter for the reason). + if (cat != IntentFilter.MATCH_CATEGORY_TYPE + || (!"file".equals(data.getScheme()) + && !"content".equals(data.getScheme()))) { + filter.addDataScheme(data.getScheme()); + + // Look through the resolved filter to determine which part + // of it matched the original Intent. + Iterator<IntentFilter.AuthorityEntry> aIt = ri.filter.authoritiesIterator(); + if (aIt != null) { + while (aIt.hasNext()) { + IntentFilter.AuthorityEntry a = aIt.next(); + if (a.match(data) >= 0) { + int port = a.getPort(); + filter.addDataAuthority(a.getHost(), + port >= 0 ? Integer.toString(port) : null); + break; + } } } - } - Iterator<PatternMatcher> pIt = ri.filter.pathsIterator(); - if (pIt != null) { - String path = data.getPath(); - while (path != null && pIt.hasNext()) { - PatternMatcher p = pIt.next(); - if (p.match(path)) { - filter.addDataPath(p.getPath(), p.getType()); - break; + Iterator<PatternMatcher> pIt = ri.filter.pathsIterator(); + if (pIt != null) { + String path = data.getPath(); + while (path != null && pIt.hasNext()) { + PatternMatcher p = pIt.next(); + if (p.match(path)) { + filter.addDataPath(p.getPath(), p.getType()); + break; + } } } } |