public abstract class Permissions extends Object
has(Context, String) and for set of permissions can be used hasAllOf(Context, String...)
or hasAnyOf(Context, String...) methods.| Modifier | Constructor and Description |
|---|---|
protected |
Permissions()
Creates a new empty instance of Permissions.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
has(Context context,
String permission)
Checks whether the specified permission is granted for the current process and
user id.
|
static boolean |
hasAllOf(Context context,
String... permissions)
Checks whether all of the specified permissions are granted for the current process
and user id.
|
static boolean |
hasAnyOf(Context context,
String... permissions)
Checks whether any of the specified permissions is granted for the current process
and user id.
|
protected Permissions()
@CheckResult public static boolean hasAnyOf(@NonNull Context context, @NonNull String... permissions)
context - Context used to check permission.permissions - The desired set of permissions to check if they are granted.True if at least one of the specified permissions is granted, false
otherwise.has(Context, String),
hasAllOf(Context, String...)@CheckResult public static boolean hasAllOf(@NonNull Context context, @NonNull String... permissions)
context - Context used to check permission.permissions - The desired set of permissions to check if they are granted.True if all of the specified permissions are granted, false otherwise.has(Context, String),
hasAnyOf(Context, String...)@CheckResult public static boolean has(@NonNull Context context, @NonNull String permission)
context - Context used to check permission.permission - The desired permission to check if it is granted.True if the specified permission is granted, false otherwise.Context.checkPermission(String, int, int),
Manifest.permission