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.
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.
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 orRequestMultiplePermissions
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 thefeature/voicecommand
project.I would love to implement this upgrade over the entire project in future. Let me know your thoughts.