Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75481cb8 authored by Patrick Scott's avatar Patrick Scott
Browse files

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
parent 981ccfbb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);