summaryrefslogtreecommitdiffstats
path: root/core/java/android/pim
diff options
context:
space:
mode:
authorAlon Albert <aalbert@google.com>2011-02-22 21:23:50 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-02-22 21:23:50 -0800
commita0946d6399431d3cc86ef06d44695251ab04933b (patch)
treeabe1c7cd0e64ee1cf04723a347d47c469dcce4b3 /core/java/android/pim
parent190d4e29f978742b14e196119e977f0f409b6b86 (diff)
parent1aba843dc327490a749059bcddff90e8048ed75c (diff)
downloadframeworks_base-a0946d6399431d3cc86ef06d44695251ab04933b.zip
frameworks_base-a0946d6399431d3cc86ef06d44695251ab04933b.tar.gz
frameworks_base-a0946d6399431d3cc86ef06d44695251ab04933b.tar.bz2
am 1aba843d: am ccc802e1: Merge "Support quoted parameters" into gingerbread
* commit '1aba843dc327490a749059bcddff90e8048ed75c': Support quoted parameters
Diffstat (limited to 'core/java/android/pim')
-rw-r--r--core/java/android/pim/ICalendar.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/pim/ICalendar.java b/core/java/android/pim/ICalendar.java
index cc0f45e..9c4eaf4 100644
--- a/core/java/android/pim/ICalendar.java
+++ b/core/java/android/pim/ICalendar.java
@@ -578,6 +578,23 @@ public class ICalendar {
+ text);
}
parameter.name = text.substring(startIndex + 1, equalIndex);
+ } else if (c == '"') {
+ if (parameter == null) {
+ throw new FormatException("Expected parameter before '\"' in " + text);
+ }
+ if (equalIndex == -1) {
+ throw new FormatException("Expected '=' within parameter in " + text);
+ }
+ if (state.index > equalIndex + 1) {
+ throw new FormatException("Parameter value cannot contain a '\"' in " + text);
+ }
+ final int endQuote = text.indexOf('"', state.index + 1);
+ if (endQuote < 0) {
+ throw new FormatException("Expected closing '\"' in " + text);
+ }
+ parameter.value = text.substring(state.index + 1, endQuote);
+ state.index = endQuote + 1;
+ return parameter;
}
++state.index;
}