Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4882ca2 authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Advance encodedKeySearchIndex if encodedKey matches a suffix of a parameter."

parents e3b2df82 e41c3173
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
+8 −0
Original line number Diff line number Diff line
@@ -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"));
    }
}