diff options
author | Kenny Root <kroot@google.com> | 2010-03-22 23:18:52 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-22 23:18:52 -0700 |
commit | b4882ca26fbf55c385fbc2b37e1bab6a13ee963a (patch) | |
tree | 4b080643dab6ffa7f9d32394a19e9b7d247d74c4 | |
parent | e3b2df827fa3bc36abdf151bc4903c5bc63a0578 (diff) | |
parent | e41c317348cfe23a78bfd97609c3489c6cc4a786 (diff) | |
download | frameworks_base-b4882ca26fbf55c385fbc2b37e1bab6a13ee963a.zip frameworks_base-b4882ca26fbf55c385fbc2b37e1bab6a13ee963a.tar.gz frameworks_base-b4882ca26fbf55c385fbc2b37e1bab6a13ee963a.tar.bz2 |
Merge "Advance encodedKeySearchIndex if encodedKey matches a suffix of a parameter."
-rw-r--r-- | core/java/android/net/Uri.java | 2 | ||||
-rw-r--r-- | core/tests/coretests/src/android/net/UriTest.java | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java index f2ea539..eca4569 100644 --- a/core/java/android/net/Uri.java +++ b/core/java/android/net/Uri.java @@ -1598,6 +1598,8 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { end = query.length(); } return decode(query.substring(equalsIndex + 1, end)); + } else { + encodedKeySearchIndex = equalsIndex + 1; } } return null; diff --git a/core/tests/coretests/src/android/net/UriTest.java b/core/tests/coretests/src/android/net/UriTest.java index ad71fcb..095ee13 100644 --- a/core/tests/coretests/src/android/net/UriTest.java +++ b/core/tests/coretests/src/android/net/UriTest.java @@ -574,5 +574,13 @@ public class UriTest extends TestCase { .appendQueryParameter("key", "y z") .build(); assertEquals("y z", uri.getQueryParameter("key")); + + // key is a substring of parameters, but not present + uri = Uri.parse("http://test/").buildUpon() + .appendQueryParameter("akeyb", "a b") + .appendQueryParameter("keya", "c d") + .appendQueryParameter("bkey", "e f") + .build(); + assertNull(uri.getQueryParameter("key")); } } |