-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Android module to handle permissions. #26553
Conversation
There are some style issues to fix: https://travis-ci.org/godotengine/godot/jobs/501245161
Agreed, this should be transparent to the user. (And probably not require any change to |
CC @godotengine/android |
this is very android specific and yes user don't need to call any of these manually. (can call it manually though) |
5650dcb
to
1f74f40
Compare
I think the first step should be auto initializing the AndroidPermissions singleton without the need for adding lines to the project.godot file. This can of course be accomplished here: godot/platform/android/java_glue.cpp Line 832 in 45e7306
Certainly not the correct place to do it, I'm accepting suggestions from people more familiar with the structure of the code to how/where this should be done. :) |
I agree the singleton should be loaded automatically, while many android games won't be accessing things like the camera or microphone having the structure in place makes sense. As for calling permissions, there is no point doing this from GDScript. It will always be a result of using core components, so when you use the microphone API, that should have code in it to access the permissions system. Same for me with camera/ARCore, it'll be in the camera logic or ARCore logic that we'll be calling into the permissions system. A user who ends up using this functionality piggy backs on the fact that the logic checks if the permissions are in place. |
See #26756 where @marcelofg55 built the base OS structure that should allow all Godot systems to place the appropriate permission requests out of the box. |
I am going to rewrite this from scratch I think, so will definitely ask for help |
What is the status of this? There is still no way to request filesystem permissions. |
This PR adds the (missing part of) module from https://github.com/vanyasem/Godot-AndroidPermissions that manages permissions on Android. It's basically the same code with a typo fix.
This is a common need for Android projects, so IMO this should be integrated with the engine, as most people are expecting this functionality out of the box: #26506 and #12323.
To use we still need to add the following to the project.godot file:
This addition should probably be automated somehow, as this is not any more an external module.