summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorFeralBytes <feralbytes@gmail.com>2018-09-26 23:59:32 -0800
committerJordan C Farrell <feralbytes@gmail.com>2018-09-27 19:20:26 -0800
commit39738d1866ae642cd99e496dde12908e01911631 (patch)
tree9bebe010420752ef978744d7245a2d1c79f00a91 /platform
parent9108b5fba5b325ba0dc4731d2623645c9a1d40a1 (diff)
Add support for onRequestPermissionsResult()
Credit goes to @vanyasem https://github.com/vanyasem/Godot-AndroidPermissions But this is a much needed feature to support Android beyond API 21. Fixed style errors again.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 92c9be5d43..c23037f3e0 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -184,6 +184,9 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
protected void onMainActivityResult(int requestCode, int resultCode, Intent data) {
}
+ protected void onMainRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ }
+
protected void onMainPause() {}
protected void onMainResume() {}
protected void onMainDestroy() {}
@@ -251,6 +254,13 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
}
};
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ for (int i = 0; i < singleton_count; i++) {
+ singletons[i].onMainRequestPermissionsResult(requestCode, permissions, grantResults);
+ }
+ };
+
public void onVideoInit() {
boolean use_gl3 = getGLESVersionCode() >= 0x00030000;