summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2011-07-07 22:45:11 -0700
committerGuang Zhu <guangzhu@google.com>2011-07-07 22:50:54 -0700
commit8ffb0c0210857210a51d7a9a0f1afb73afbf8677 (patch)
tree3ce281a62dcb94c3932b6830c7b3e42091c4d532 /cmds/am
parent4a6d113ba0f33ce5dc14e59463e928ba309e1c2e (diff)
downloadframeworks_base-8ffb0c0210857210a51d7a9a0f1afb73afbf8677.zip
frameworks_base-8ffb0c0210857210a51d7a9a0f1afb73afbf8677.tar.gz
frameworks_base-8ffb0c0210857210a51d7a9a0f1afb73afbf8677.tar.bz2
allow Uri as intent extra in am command
When composing an intent using am command line, certain extra fields need to be added as a Uri (a Parceable in fact). This patch adds a "--eu" parameter so that the provided value is parsed as a Uri then added into intent's extra bundle. Change-Id: I7110829554962d314aa58fd25083dd5041680a73
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 479b70a..3fb1736 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -157,6 +157,11 @@ public class Am {
String value = nextArgRequired();
intent.putExtra(key, Integer.valueOf(value));
hasIntentInfo = true;
+ } else if (opt.equals("--eu")) {
+ String key = nextArgRequired();
+ String value = nextArgRequired();
+ intent.putExtra(key, Uri.parse(value));
+ hasIntentInfo = true;
} else if (opt.equals("--eia")) {
String key = nextArgRequired();
String value = nextArgRequired();
@@ -1119,6 +1124,7 @@ public class Am {
" [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]\n" +
" [--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]\n" +
" [--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...]\n" +
+ " [--eu <EXTRA_KEY> <EXTRA_URI_VALUE> ...]\n" +
" [--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]]\n" +
" [--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]]\n" +
" [-n <COMPONENT>] [-f <FLAGS>]\n" +