hasPermission

fun Context?.hasPermission(permission: String): Boolean

Helper method for checking if a permission is allowed. In case of error the permission is reported as denied.

Return

true if the calling pid/uid is allowed the permission (i.e. PERMISSION_GRANTED)

Parameters

permission

The string name of a permission to check.