Determining Existing Permissions
To test if an application already has permission for a resource, the method hasPermissionFor() can be used:
if(PermissionsManager.hasPermissionFor(PermissionsManager.PERMISSION_CAMERA))
{
//do something with the camera
...
}