mirror of
https://gitee.com/shuto/cordova-plugin-file-opener2.git
synced 2025-01-31 12:02:49 +08:00
Remove unnecessary context.grantUriPermission()
This commit is contained in:
parent
ade1872a5c
commit
8dd6ca756c
@ -111,12 +111,6 @@ public class FileOpener2 extends CordovaPlugin {
|
|||||||
intent.setDataAndType(path, contentType);
|
intent.setDataAndType(path, contentType);
|
||||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NO_HISTORY);
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NO_HISTORY);
|
||||||
//intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
//intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
|
||||||
List<ResolveInfo> 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 {
|
else {
|
||||||
intent.setDataAndType(path, contentType);
|
intent.setDataAndType(path, contentType);
|
||||||
|
Loading…
Reference in New Issue
Block a user