summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-03-22 23:18:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-03-22 23:18:52 -0700
commitb4882ca26fbf55c385fbc2b37e1bab6a13ee963a (patch)
tree4b080643dab6ffa7f9d32394a19e9b7d247d74c4
parente3b2df827fa3bc36abdf151bc4903c5bc63a0578 (diff)
parente41c317348cfe23a78bfd97609c3489c6cc4a786 (diff)
downloadframeworks_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.java2
-rw-r--r--core/tests/coretests/src/android/net/UriTest.java8
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"));
}
}