Only ask for storage permissions when not using SAF
This commit is contained in:
parent
febb21a01d
commit
7efe62ee80
|
@ -18,6 +18,7 @@ import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import org.schabi.newpipe.R;
|
import org.schabi.newpipe.R;
|
||||||
|
import org.schabi.newpipe.settings.NewPipeSettings;
|
||||||
|
|
||||||
public final class PermissionHelper {
|
public final class PermissionHelper {
|
||||||
public static final int DOWNLOAD_DIALOG_REQUEST_CODE = 778;
|
public static final int DOWNLOAD_DIALOG_REQUEST_CODE = 778;
|
||||||
|
@ -26,6 +27,10 @@ public final class PermissionHelper {
|
||||||
private PermissionHelper() { }
|
private PermissionHelper() { }
|
||||||
|
|
||||||
public static boolean checkStoragePermissions(final Activity activity, final int requestCode) {
|
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)) {
|
if (!checkReadStoragePermissions(activity, requestCode)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue