public class PermissionsManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
PERMISSION_CAMERA
Permission to access the camera hardware.
|
static int |
PERMISSION_LOCATION_GENERAL
Permission to access the general location, usually gained through Wi-Fi or local cell phone tower.
|
static int |
PERMISSION_LOCATION_PRECISE
Permission to access a precise location, usually gained through GPS.
|
static int |
PERMISSION_NETWORK_STATE
Permission to discover the current state of network connectivity.
|
static int |
PERMISSION_READ_EXT_STORAGE
Permission to read data from external storage.
|
static int |
PERMISSION_SEND_SMS
Permission to create and send SMS messages.
|
static int |
PERMISSION_WRITE_EXT_STORAGE
Permission to write to external storage.
|
Constructor and Description |
---|
PermissionsManager() |
Modifier and Type | Method and Description |
---|---|
static boolean |
hasPermissionFor(int permissionType)
Check to see if the application already has permission for this operation or resource.
|
static void |
requestPermissionFor(int permissionType,
IPermissionCallback responseCallback)
Ask for the permission to use this operation or resource.
|
public static final int PERMISSION_CAMERA
public static final int PERMISSION_LOCATION_GENERAL
public static final int PERMISSION_LOCATION_PRECISE
public static final int PERMISSION_NETWORK_STATE
public static final int PERMISSION_SEND_SMS
public static final int PERMISSION_WRITE_EXT_STORAGE
public static final int PERMISSION_READ_EXT_STORAGE
public static boolean hasPermissionFor(int permissionType)
permissionType
- one of the PERMISSON_*
constants.true
if permission has already been granted, false
if not.public static void requestPermissionFor(int permissionType, IPermissionCallback responseCallback)
permissionType
- one of the PERMISSON_*
constants.responseCallback
- an IPermissionCallback
Object that will be notified when
permissions are granted or denied.