From cb2b1df9dc480b6ef86ee334ab3fa0eb598987bf Mon Sep 17 00:00:00 2001 From: LoxiaLiSA2 Date: Thu, 10 Aug 2023 15:10:15 +0800 Subject: [PATCH] respect configs.isCheckPermission --- .../filepicker/activity/DirSelectActivity.java | 10 ++++++---- .../filepicker/activity/FilePickerActivity.java | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/DirSelectActivity.java b/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/DirSelectActivity.java index 7f44fe3..ff135b6 100644 --- a/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/DirSelectActivity.java +++ b/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/DirSelectActivity.java @@ -276,10 +276,12 @@ public boolean onCameraClick(boolean forVideo) { public boolean requestPermission(String[] permissions, int requestCode) { int checkResult = PackageManager.PERMISSION_GRANTED; - for (String permission : permissions) { - if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) { - checkResult = PackageManager.PERMISSION_DENIED; - break; + if (configs.isCheckPermission()) { + for (String permission : permissions) { + if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) { + checkResult = PackageManager.PERMISSION_DENIED; + break; + } } } if (checkResult != PackageManager.PERMISSION_GRANTED) { diff --git a/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/FilePickerActivity.java b/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/FilePickerActivity.java index a619110..641b036 100644 --- a/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/FilePickerActivity.java +++ b/filepicker/src/main/java/com/jaiselrahman/filepicker/activity/FilePickerActivity.java @@ -318,10 +318,12 @@ public boolean onCameraClick(boolean forVideo) { public boolean requestPermission(String[] permissions, int requestCode) { int checkResult = PackageManager.PERMISSION_GRANTED; - for (String permission : permissions) { - if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) { - checkResult = PackageManager.PERMISSION_DENIED; - break; + if (configs.isCheckPermission()) { + for (String permission : permissions) { + if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) { + checkResult = PackageManager.PERMISSION_DENIED; + break; + } } } if (checkResult != PackageManager.PERMISSION_GRANTED) {