From 604a598e1e01bda781600a45e0a971898a582666 Mon Sep 17 00:00:00 2001 From: Huahui Wu Date: Tue, 22 Mar 2011 15:00:11 -0700 Subject: DO NOT MERGE b/4088884 Backport "Remove content:// protocol handler in web browser" to Gingerbread It's a manual cherrypick of https://android-git.corp.google.com/g/#change,88728 since a lot has been changed in bettween. Change-Id: I6a0e4579a98ebda6b89daad0b520bdd80d819a17 --- src/com/android/browser/BrowserActivity.java | 9 +-------- src/com/android/browser/BrowserSettings.java | 2 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 793f689..435560b 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -622,13 +622,6 @@ public class BrowserActivity extends Activity final String action = intent.getAction(); if (Intent.ACTION_VIEW.equals(action)) { url = smartUrlFilter(intent.getData()); - if (url != null && url.startsWith("content:")) { - /* Append mimetype so webview knows how to display */ - String mimeType = intent.resolveType(getContentResolver()); - if (mimeType != null) { - url += "?" + mimeType; - } - } if (url != null && url.startsWith("http")) { final Bundle pairs = intent .getBundleExtra(Browser.EXTRA_HEADERS); @@ -3656,7 +3649,7 @@ public class BrowserActivity extends Activity "(?i)" + // switch on case insensitive matching "(" + // begin group for schema "(?:http|https|file):\\/\\/" + - "|(?:inline|data|about|content|javascript):" + + "|(?:inline|data|about|javascript):" + ")" + "(.*)" ); diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java index 3791eb0..a322b59 100644 --- a/src/com/android/browser/BrowserSettings.java +++ b/src/com/android/browser/BrowserSettings.java @@ -229,6 +229,8 @@ class BrowserSettings extends Observable { s.setNeedInitialFocus(false); // Browser supports multiple windows s.setSupportMultipleWindows(true); + // disable content url access + s.setAllowContentAccess(false); // HTML5 API flags s.setAppCacheEnabled(b.appCacheEnabled); -- cgit v1.1