From 7efe62ee80fa4f889f20b11a6110a3b363274206 Mon Sep 17 00:00:00 2001 From: wb9688 Date: Sun, 2 Aug 2020 11:23:40 +0200 Subject: [PATCH] Only ask for storage permissions when not using SAF --- .../main/java/org/schabi/newpipe/util/PermissionHelper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/util/PermissionHelper.java b/app/src/main/java/org/schabi/newpipe/util/PermissionHelper.java index 03400bdbb..c64631b72 100644 --- a/app/src/main/java/org/schabi/newpipe/util/PermissionHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/PermissionHelper.java @@ -18,6 +18,7 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import org.schabi.newpipe.R; +import org.schabi.newpipe.settings.NewPipeSettings; public final class PermissionHelper { public static final int DOWNLOAD_DIALOG_REQUEST_CODE = 778; @@ -26,6 +27,10 @@ public final class PermissionHelper { private PermissionHelper() { } public static boolean checkStoragePermissions(final Activity activity, final int requestCode) { + if (NewPipeSettings.useStorageAccessFramework(activity)) { + return true; // Storage permissions are not needed for SAF + } + if (!checkReadStoragePermissions(activity, requestCode)) { return false; }