Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(googlegh-1781): check for
Denied(shouldShowRationale=false)
in …
…`MutableMultiplePermissionsState.shouldShowRationale` `launchMultiplePermissionRequest` is typically called when `shouldShowRationale` returns true. However, what may not be as obvious is that `launchMultiplePermissionRequest` appears to result in a noop if one or more permissions in `MutableMultiplePermissionsState` are `Denied(shouldShowRationale=false)`. This caused issues for us in some code similar to this: ```kotlin val permissions = rememberMultiplePermissionsState( listOf( ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION, ) ) when { // Granted permissions.allPermissionsGranted -> /* ... */, // Denied, but I can ask the user permissions.shouldShowRationale -> // UNEXPECTED: Does not trigger! permissions.launchMultiplePermissionRequest() // Denied and I may not ask the user. else -> /* ... */ } ``` The fix would seem to be to additionally make sure that there are no permissions with the `Denied(shouldShowRationale=false)` status before returning a truthy value from `shouldShowRationale`.
- Loading branch information