From db3d43dfe0235c61e6ed12413fba86d8225cb04f Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 11 Feb 2011 11:56:38 -0800 Subject: Handle unsupported schema case better Bug: 3442811 3443962 Fix it so that the check for specialized handlers takes into account whether or not webkit can even handle the schema. If it can't handle the schema, we always want to call startActivity Change-Id: Ib7667f9fe6c3ea0602ccc1fdfce09b5920757a63 --- src/com/android/browser/UrlHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/com/android/browser/UrlHandler.java') diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java index 686ed7b90..03bab9bcd 100644 --- a/src/com/android/browser/UrlHandler.java +++ b/src/com/android/browser/UrlHandler.java @@ -20,7 +20,6 @@ import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.IntentFilter; -import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.database.Cursor; @@ -31,6 +30,7 @@ import android.webkit.WebView; import java.net.URISyntaxException; import java.util.List; +import java.util.regex.Matcher; /** * @@ -156,7 +156,11 @@ public class UrlHandler { // security (only access to BROWSABLE activities). intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.setComponent(null); - if (!isSpecializedHandlerAvailable(intent)) { + // Make sure webkit can handle it internally before checking for specialized + // handlers. If webkit can't handle it internally, we need to call + // startActivityIfNeeded + Matcher m = UrlUtils.ACCEPTED_URI_SCHEMA.matcher(url); + if (m.matches() && !isSpecializedHandlerAvailable(intent)) { return false; } try { -- cgit v1.2.3