summaryrefslogtreecommitdiff
path: root/platform/android/java/lib/src
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuyakou@gmail.com>2020-05-04 14:48:30 -0700
committerFredia Huya-Kouadio <fhuyakou@gmail.com>2020-05-05 10:33:46 +0200
commitef62506e5cc3f61b020ac0679bb3122a346e50af (patch)
tree78d9b249419bccfd7528d1c4ec8b20b3c976fc86 /platform/android/java/lib/src
parent1c23a0cc7f879774f56404378db1bf86979e42d1 (diff)
Address `OS.request_permissions()` bug when non-platform permission(s) is included
Diffstat (limited to 'platform/android/java/lib/src')
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java11
1 files changed, 7 insertions, 4 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 7cf32b00fe..a0f8bb8cb7 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
@@ -36,6 +36,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PermissionInfo;
import android.os.Build;
import android.support.v4.content.ContextCompat;
+import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import org.godotengine.godot.Godot;
@@ -46,6 +47,8 @@ import org.godotengine.godot.Godot;
*/
public final class PermissionsUtil {
+ private static final String TAG = PermissionsUtil.class.getSimpleName();
+
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;
static final int REQUEST_CAMERA_PERMISSION = 2;
static final int REQUEST_VIBRATE_PERMISSION = 3;
@@ -113,8 +116,8 @@ public final class PermissionsUtil {
dangerousPermissions.add(manifestPermission);
}
} catch (PackageManager.NameNotFoundException e) {
- e.printStackTrace();
- return false;
+ // Skip this permission and continue.
+ Log.w(TAG, "Unable to identify permission " + manifestPermission, e);
}
}
@@ -153,8 +156,8 @@ public final class PermissionsUtil {
dangerousPermissions.add(manifestPermission);
}
} catch (PackageManager.NameNotFoundException e) {
- e.printStackTrace();
- return new String[0];
+ // Skip this permission and continue.
+ Log.w(TAG, "Unable to identify permission " + manifestPermission, e);
}
}