Modify tests to reflect different URL encoding for single quote

Single quotes in query parameters in HttpURLConnection changed
behavior between M and N due to upstream changes in OkHttp:
in N, single quotes started being encoded as %27 when present in
query parameters. Unfortunately, this broke several "iTunes remote"
apps: iTunes appears not to support %27 encoding for single quotes
in its DAAP server.

Bug: 30405333
Test: (old) cts test packages android.core.tests.libcore.package.okhttp
    and android.core.tests.libcore.package.libcore
Change-Id: Id87da28529098f639d3be6aed0626d5e3996739d
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index f609ccf..4313512 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -2283,8 +2283,13 @@
         testUrlToRequestMapping("$", "$", "$");
         testUrlToUriMapping("&", "&", "&", "&", "&");
         testUrlToRequestMapping("&", "&", "&");
-        testUrlToUriMapping("'", "'", "'", "%27", "'");
-        testUrlToRequestMapping("'", "'", "%27");
+
+        // http://b/30405333 - upstream OkHttp encodes single quote (') as %27 in query parameters
+        // but this breaks iTunes remote apps: iTunes currently does not accept %27 so we have a
+        // local patch to retain the historic Android behavior of not encoding single quote.
+        testUrlToUriMapping("'", "'", "'", "'", "'");
+        testUrlToRequestMapping("'", "'", "'");
+
         testUrlToUriMapping("(", "(", "(", "(", "(");
         testUrlToRequestMapping("(", "(", "(");
         testUrlToUriMapping(")", ")", ")", ")", ")");