diff options
author | Dale Hawkins <dkhawk@google.com> | 2014-02-27 21:29:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-02-27 21:29:32 +0000 |
commit | 8a78a807097397ccd9c6ea20868f71c7ee19ef1d (patch) | |
tree | 31230dcc3bf2257996e77a5286114b337980e5f8 /cmds | |
parent | b11e98b2c1dcafd6efe8d517050d740bf94f0152 (diff) | |
parent | 28600e261c088eddcd0201820ed93730c77af282 (diff) | |
download | frameworks_base-8a78a807097397ccd9c6ea20868f71c7ee19ef1d.zip frameworks_base-8a78a807097397ccd9c6ea20868f71c7ee19ef1d.tar.gz frameworks_base-8a78a807097397ccd9c6ea20868f71c7ee19ef1d.tar.bz2 |
Merge "Adds support for array string extra."
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 11 |
1 files changed, 11 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 89e15d2..01e7615 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -232,6 +232,8 @@ public class Am extends BaseCommand { " [--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]]\n" + " [--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]]\n" + " [--efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]]\n" + + " [--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]]\n" + + " (to embed a comma into a string escape it using \"\\,\")\n" + " [-n <COMPONENT>] [-f <FLAGS>]\n" + " [--grant-read-uri-permission] [--grant-write-uri-permission]\n" + " [--debug-log-resolution] [--exclude-stopped-packages]\n" + @@ -419,6 +421,15 @@ public class Am extends BaseCommand { } intent.putExtra(key, list); hasIntentInfo = true; + } else if (opt.equals("--esa")) { + String key = nextArgRequired(); + String value = nextArgRequired(); + // Split on commas unless they are preceeded by an escape. + // The escape character must be escaped for the string and + // again for the regex, thus four escape characters become one. + String[] strings = value.split("(?<!\\\\),"); + intent.putExtra(key, strings); + hasIntentInfo = true; } else if (opt.equals("--ez")) { String key = nextArgRequired(); String value = nextArgRequired(); |