Permission Request
Used to check the status of a permission.
The result of the check is notified on the listeners attached to the PermissionRequest. To avoid memory leaks, it's recommended to remove the attached listeners when the instance that holds this PermissionRequest is destroyed or to build the PermissionRequest in a method always executed during the instance's lifecycle.
E.g. considering an Activity that wants to check the status of a permission when an action is done by the user, it's recommended to build the request at Activity.onCreate and send it when the action is done instead of build and send it at the same moment. This could avoid a potential memory leak when the Activity is rotated.
Types
Functions
Checks the status of permissions of this request without sending it. Below API 23, this method and send should have the same behavior since the permissions status can be checked without sending a runtime request. Below API 23, the possible status are:
Removes all the listeners added to this request.
Removes a Listener added with addListener which should not be notified anymore.
Sends the PermissionRequest and performs the checks on its status. The result will be returned to the attached listeners.
Inheritors
Extensions
Observes the PermissionRequest's status. The returned LiveData emits the list of PermissionStatus when the result of PermissionRequest.send is received. The documentation of the possible values of PermissionStatus can be found at PermissionRequest.Listener.onPermissionsResult.
Sends the PermissionRequest and performs the checks on its status. The result will be returned in the given callback.