-
@Stable() public interface MultiplePermissionsStateA state object that can be hoisted to control and observe multiple permissions status changes.
In most cases, this will be created via rememberMultiplePermissionsState.
It's recommended that apps exercise the permissions workflow as described in the documentation.
-
-
Method Summary
Modifier and Type Method Description abstract UnitlaunchMultiplePermissionRequest()Request the permissions to the user. abstract List<PermissionState>getPermissions()List of all permissions to request. abstract List<PermissionState>getRevokedPermissions()List of permissions revoked by the user. abstract BooleangetAllPermissionsGranted()When true, the user has granted all permissions.abstract BooleangetShouldShowRationale()When true, the user should be presented with a rationale.-
-
Method Detail
-
launchMultiplePermissionRequest
abstract Unit launchMultiplePermissionRequest()
Request the permissions to the user.
This should always be triggered from non-composable scope, for example, from a side-effect or a non-composable callback. Otherwise, this will result in an IllegalStateException.
This triggers a system dialog that asks the user to grant or revoke the permission. Note that this dialog might not appear on the screen if the user doesn't want to be asked again or has denied the permission multiple times. This behavior varies depending on the Android level API.
-
getPermissions
abstract List<PermissionState> getPermissions()
List of all permissions to request.
-
getRevokedPermissions
abstract List<PermissionState> getRevokedPermissions()
List of permissions revoked by the user.
-
getAllPermissionsGranted
abstract Boolean getAllPermissionsGranted()
When
true, the user has granted all permissions.
-
getShouldShowRationale
abstract Boolean getShouldShowRationale()
When
true, the user should be presented with a rationale.
-
-
-
-