Don't cut the url on a redirect

This is a fix for issue 2485033. It is not a final fix, but just starting with this so it can be discussed on code review. The line in question
was added to fix issue 1690652.

Updated fix. Stores the url before it is cut during a redirect. Forwards this to the reponse instead of the cut url.

Update 2: Using the old originalUrl

Change-Id: I286084451aa45e51d5d07811f9d119cf83849592
diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java
index 115499f..7da99ca 100644
--- a/core/java/android/webkit/LoadListener.java
+++ b/core/java/android/webkit/LoadListener.java
@@ -1057,7 +1057,7 @@
                 mCacheLoader != null) ? HTTP_OK : mStatusCode;
         // pass content-type content-length and content-encoding
         final int nativeResponse = nativeCreateResponse(
-                mUrl, statusCode, mStatusText,
+                originalUrl(), statusCode, mStatusText,
                 mMimeType, mContentLength, mEncoding);
         if (mHeaders != null) {
             mHeaders.getHeaders(new Headers.HeaderCallback() {
@@ -1256,9 +1256,6 @@
                 return;
             }
 
-            if (mOriginalUrl == null) {
-                mOriginalUrl = mUrl;
-            }
 
             // Cache the redirect response
             if (getErrorID() == OK) {
@@ -1273,6 +1270,8 @@
                         WebViewWorker.MSG_REMOVE_CACHE, this).sendToTarget();
             }
 
+            // Saving a copy of the unstripped url for the response
+            mOriginalUrl = redirectTo;
             // This will strip the anchor
             setUrl(redirectTo);