cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject android commit: CB-5398 Work-around for KitKat content: URLs not rendering in <img> tags
Date Thu, 13 Feb 2014 21:10:58 GMT
Updated Branches:
  refs/heads/master 87285d94f -> 954a1723f


CB-5398 Work-around for KitKat content: URLs not rendering in <img> tags


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/954a1723
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/954a1723
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/954a1723

Branch: refs/heads/master
Commit: 954a1723f1c0ebc432c68facfbda7975027554a2
Parents: 87285d9
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Feb 13 15:56:24 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Feb 13 16:10:40 2014 -0500

----------------------------------------------------------------------
 .../org/apache/cordova/IceCreamCordovaWebViewClient.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/954a1723/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
index 7eb759e..5f32243 100644
--- a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
+++ b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
@@ -59,7 +59,7 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient {
             // Allow plugins to intercept WebView requests.
             Uri remappedUri = resourceApi.remapUri(origUri);
             
-            if (!origUri.equals(remappedUri) || needsSpecialsInAssetUrlFix(origUri)) {
+            if (!origUri.equals(remappedUri) || needsSpecialsInAssetUrlFix(origUri) || needsKitKatContentUrlFix(origUri))
{
                 OpenForReadResult result = resourceApi.openForRead(remappedUri, true);
                 return new WebResourceResponse(result.mimeType, "UTF-8", result.inputStream);
             }
@@ -74,6 +74,14 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient
{
         }
     }
 
+    private static boolean needsKitKatContentUrlFix(Uri uri) {
+        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT)
{
+            if ("content".equals(uri.getScheme()) && uri.toString().contains("%3A"))
{
+                return true;
+            }
+        }
+        return false;
+    }
     private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
         if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
             return false;


Mime
View raw message