From 28600e261c088eddcd0201820ed93730c77af282 Mon Sep 17 00:00:00 2001 From: Dale Hawkins Date: Wed, 26 Feb 2014 16:39:51 -0700 Subject: Adds support for array string extra. Adds support for setting an array string extra on an intent when launching an activity/service. Allows inclusion of commas using an escape character. Change-Id: I8857f7d28d60b75ddc65dc47f345a77230d00467 --- cmds/am/src/com/android/commands/am/Am.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmds/am') 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 [, [, [, [,] [-f ]\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("(?