diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/utils/PermissionUtils.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/PermissionUtils.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/PermissionUtils.java b/src/main/java/de/pixart/messenger/utils/PermissionUtils.java index b21ca8869..57a830080 100644 --- a/src/main/java/de/pixart/messenger/utils/PermissionUtils.java +++ b/src/main/java/de/pixart/messenger/utils/PermissionUtils.java @@ -23,6 +23,15 @@ public class PermissionUtils { return false; } + public static boolean readGranted(int[] grantResults, String[] permission) { + for (int i = 0; i < grantResults.length; ++i) { + if (Manifest.permission.READ_EXTERNAL_STORAGE.equals(permission[i])) { + return grantResults[i] == PackageManager.PERMISSION_GRANTED; + } + } + return false; + } + public static String getFirstDenied(int[] grantResults, String[] permissions) { for (int i = 0; i < grantResults.length; ++i) { if (grantResults[i] == PackageManager.PERMISSION_DENIED) { |