Skip to content
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

Closed

Conversation

MadEqua
Copy link
Contributor

@MadEqua MadEqua commented Mar 3, 2019

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:

[android]
modules="org/godotengine/godot/permissions/AndroidPermissions"

This addition should probably be automated somehow, as this is not any more an external module.

@akien-mga
Copy link
Member

akien-mga commented Mar 4, 2019

There are some style issues to fix: https://travis-ci.org/godotengine/godot/jobs/501245161
See Style guidelines.

This addition should probably be automated somehow, as this is not any more an external module.

Agreed, this should be transparent to the user. (And probably not require any change to project.godot, I don't think it has to be a module, this should be a core part of the Android port.)

@akien-mga
Copy link
Member

CC @godotengine/android

@volzhs
Copy link
Contributor

volzhs commented Mar 4, 2019

this is very android specific and yes user don't need to call any of these manually. (can call it manually though)
it should be called automatically when needed.

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Mar 4, 2019
@MadEqua MadEqua force-pushed the android-runtime-permissions branch from 5650dcb to 1f74f40 Compare March 5, 2019 12:41
@MadEqua
Copy link
Contributor Author

MadEqua commented Mar 5, 2019

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:

static void _initialize_java_modules() {

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. :)

@BastiaanOlij
Copy link
Contributor

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.

@akien-mga
Copy link
Member

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.

@reduz
Copy link
Member

reduz commented Apr 4, 2019

I am going to rewrite this from scratch I think, so will definitely ask for help

@MadEqua MadEqua closed this Apr 15, 2019
@MadEqua MadEqua deleted the android-runtime-permissions branch April 15, 2019 17:02
@raymoo
Copy link
Contributor

raymoo commented Jun 6, 2019

What is the status of this? There is still no way to request filesystem permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants