diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-10-18 17:26:56 -0400 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-10-18 17:26:56 -0400 |
commit | ebbe3e8c51fcf89f6b19a74497cedb5a8c448979 (patch) | |
tree | 075435b3a1b3ac57a75f1ca90865f61697c053f4 /platform/android/java/lib | |
parent | edb8e2b1b2b09236bdcd76cb6c8b40b6fbb2abaf (diff) | |
parent | 80f0b33313dae52d072ba2771a88ebcc4f0b4d6d (diff) | |
download | redot-engine-ebbe3e8c51fcf89f6b19a74497cedb5a8c448979.tar.gz |
Merge commit godotengine/godot@80f0b33313dae52d072ba2771a88ebcc4f0b4d6d
Diffstat (limited to 'platform/android/java/lib')
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java index d2b743b788..4a616c348f 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java +++ b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java @@ -110,7 +110,7 @@ public final class PermissionsUtil { } else { PermissionInfo permissionInfo = getPermissionInfo(activity, permission); int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; - if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, permission) != PackageManager.PERMISSION_GRANTED) { + if ((protectionLevel & PermissionInfo.PROTECTION_DANGEROUS) == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, permission) != PackageManager.PERMISSION_GRANTED) { Log.d(TAG, "Requesting permission " + permission); requestedPermissions.add(permission); } @@ -176,7 +176,7 @@ public final class PermissionsUtil { try { PermissionInfo permissionInfo = getPermissionInfo(activity, permissionName); int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; - if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, permissionName) != PackageManager.PERMISSION_GRANTED) { + if ((protectionLevel & PermissionInfo.PROTECTION_DANGEROUS) == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, permissionName) != PackageManager.PERMISSION_GRANTED) { activity.requestPermissions(new String[] { permissionName }, REQUEST_SINGLE_PERMISSION_REQ_CODE); return false; } @@ -261,7 +261,7 @@ public final class PermissionsUtil { } else { PermissionInfo permissionInfo = getPermissionInfo(context, manifestPermission); int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; - if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED) { + if ((protectionLevel & PermissionInfo.PROTECTION_DANGEROUS) == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED) { grantedPermissions.add(manifestPermission); } } |