Skip to content

Requests runtime permissions list, fixes #1704 #1741

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

Merged

Conversation

AndreMiras
Copy link
Member

Matches the official Android API via, making it possible to request
multiple runtime permissions at once.

Keeps the previous android.permissions.request_permission() interface
for compatibility.

Bumps pyjnius to post 1.2.0 release that solves required method
resolution issues. On 1.2.0, the error was:

jnius.jnius.JavaException: No methods matching your arguments, available: []

@AndreMiras
Copy link
Member Author

Tested with:

request_permissions([Permission.CAMERA, Permission.WRITE_EXTERNAL_STORAGE])

As we can see in the attached screenshot (:es: sorry), it did popup a page with two permission requests.

image
image

@AndreMiras AndreMiras requested review from a user and inclement March 6, 2019 23:22
@ghost
Copy link

ghost commented Mar 7, 2019

Looks good and backwards compatible 👍 do you want me to test it as well with my app?

@AndreMiras
Copy link
Member Author

Thanks @Jonast for the review. Yes feel free to test it. Keep in mind it requires pyjnius update otherwise it would crash

ghost
ghost previously approved these changes Mar 7, 2019
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable, and I've verified with my own non-trivial app that requests sd card permissions that backwards compatibility with an old unaware app using the old call isn't broken 👍 (I runtime tested on an android device by going through the dialog and it worked as before)

@ghost
Copy link

ghost commented Mar 7, 2019

@AndreMiras oh huh I am just thinking, the docs example might also need an update, right? the one given here: https://github.com/kivy/python-for-android/blob/master/doc/source/apis.rst#runtime-permissions

Matches the official Android API via, making it possible to request
multiple runtime permissions at once.

Keeps the previous `android.permissions.request_permission()` interface
for compatibility.

Bumps pyjnius to post 1.2.0 release that solves required method
resolution issues. On 1.2.0, the error was:
```
jnius.jnius.JavaException: No methods matching your arguments, available: []
```
@AndreMiras AndreMiras force-pushed the feature/ticket1704_request_permissions branch from 4976f18 to 2ea377e Compare March 7, 2019 17:19
@AndreMiras
Copy link
Member Author

Thanks @Jonast for the review and the heads-up, I've updated the PR with the documentation changes

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! (including docs changes) 👍

@AndreMiras AndreMiras merged commit 25e5acc into kivy:master Mar 7, 2019
@AndreMiras AndreMiras deleted the feature/ticket1704_request_permissions branch March 7, 2019 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant