I am creating a library that needs to check runtime permissions. I have got runtime permissions working fine and understand the use cases without issues.
However I would like to confirm that the developer using our library has added the permission to their manifest.
The library is a location based library and the developer can either enter
PackageManager pm = getPackageManager();
int granted = pm.checkPermission(
if (granted == PackageManager.PERMISSION_GRANTED)
// Use coarse for runtime requests
// granted is always PackageManager.PERMISSION_DENIED
Off the cuff, retrieve the
getPackageInfo(getPackageName(), PackageManager.GET_PERMISSIONS). Then, look at the
requestedPermissions array in the
PackageInfo for all the