From 75481cb860519b9f839262c05679f436cfc71f37 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Wed, 9 Dec 2009 11:09:04 -0500 Subject: [PATCH] Check that the resolved activity is not in our package. Ideally, I would like to allow Activities in the same package to intercept mime types but there is no way to get the current Activity information from a generic Context object. For now, skip resolved Activities that are in the same package. Bug: 2314904 --- core/java/android/webkit/LoadListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java index 863ab8c2592f2..c2b9f20a6ce23 100644 --- a/core/java/android/webkit/LoadListener.java +++ b/core/java/android/webkit/LoadListener.java @@ -376,8 +376,9 @@ class LoadListener extends Handler implements EventHandler { i.setDataAndType(Uri.parse(url()), mMimeType); ResolveInfo info = mContext.getPackageManager().resolveActivity(i, PackageManager.MATCH_DEFAULT_ONLY); - if (info != null) { - // someone (other than the current activity) knows how to + if (info != null && !mContext.getPackageName().equals( + info.activityInfo.packageName)) { + // someone (other than the current app) knows how to // handle this mime type. try { mContext.startActivity(i);