public final class PermissionUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areAllPermissionsGranted(android.content.Context context,
java.lang.String... permissions)
Returns, whether all permissions, which are contained by a specific array, are granted, or
not.
|
static java.lang.String[] |
getNotGrantedPermissions(android.content.Context context,
java.lang.String... permissions)
Returns the subset of specific permissions, which are not granted.
|
static boolean |
isPermissionGranted(android.content.Context context,
java.lang.String permission)
Returns, whether a specific permission is granted, or not.
|
public static boolean isPermissionGranted(android.content.Context context,
java.lang.String permission)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullpermission - The permission, which should be checked, as a String, e.g.
android.Manifest.permission.CALL_PHONE. The permission may neither be
null, nor emptypublic static boolean areAllPermissionsGranted(android.content.Context context,
java.lang.String... permissions)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullpermissions - An array, which contains the permissions, e.g. android.Manifest.permission.CALL_PHONE,
which should be checked, as a String array. The array may not be nullpublic static java.lang.String[] getNotGrantedPermissions(android.content.Context context,
java.lang.String... permissions)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullpermissions - An array, which contains the permissions, e.g. android.Manifest.CALL_PHONE,
which should be checked, as a String array. The array may not be nullString
array or an empty array, if all permissions are granted