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

Using the new ActivityResults API for handling runtime permission requests #985

Closed

Conversation

devAyushDubey
Copy link

As mentioned in (mentions #982), the requestPermissions() and onRequestPermissionsResult() APIs are deprecated with androidx fragment version 1.3.0

The new approach is to use ActivityResults API and RequestPermission contract for requesting single permission at a time or RequestMultiplePermissions contract for requesting multiple permission at a time for handling runtime permission requests.

This article also mentions this quite well.

For the microphone request purpose, we have a single permission request to process so I am using RequestPermission contract here.

I see multiple locations where we are using requestPermissions() in the app and other parts of the project. This PR is specific to the feature/voicecommand project.

I would love to implement this upgrade over the entire project in future. Let me know your thoughts.

@SebaDro SebaDro added the GSoC label Apr 20, 2023
Copy link
Contributor

@cdhiraj40 cdhiraj40 left a comment

Choose a reason for hiding this comment

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

Apart from the extra comments added, everything looks good!

@devAyushDubey
Copy link
Author

Fixed in #992

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

Successfully merging this pull request may close these issues.

None yet

3 participants