From 8dd6ca756c4a484b486cfdf7a85e5f2d3bdad70a Mon Sep 17 00:00:00 2001 From: imgx64 Date: Sun, 22 Oct 2017 11:35:47 +0300 Subject: [PATCH] Remove unnecessary context.grantUriPermission() --- .../pwlin/cordova/plugins/fileopener2/FileOpener2.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java b/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java index 3dec792..b7b6fdd 100644 --- a/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java +++ b/src/android/io/github/pwlin/cordova/plugins/fileopener2/FileOpener2.java @@ -111,12 +111,6 @@ public class FileOpener2 extends CordovaPlugin { intent.setDataAndType(path, contentType); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NO_HISTORY); //intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - - List infoList = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - for (ResolveInfo resolveInfo : infoList) { - String packageName = resolveInfo.activityInfo.packageName; - context.grantUriPermission(packageName, path, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); - } } else { intent.setDataAndType(path, contentType);