Skip to content Skip to sidebar Skip to footer

How To Check What Other Apps Granted From Permissions

Can I use checkPermission (String permName, String pkgName) inside my application to check other apps granted permissions? for example If I want to check if app1 which is installed

Solution 1:

PERMISSION_GRANTED is a number. Specifically, it has a value of 0. You cannot use a number to check anything.

You canuse checkPermission() on PackageManager to see whether a particular app (identified by its application ID, a.k.a. package name) holds a particular permission. That method returns either PERMISSION_GRANTED or PERMISSION_DENIED.

However, note that on Android 6.0+ devices, if the app you are checking is compiled with a targetSdkVersion of 22 or lower, checkPermission() will return PERMISSION_GRANTED so long as the permission was requested in the manifest (at least for normal and dangerous permissions, which are usually the ones that concern you). While the user can "revoke permissions" from those apps via the Settings app, that status is not reported by checkPermission(), and indeed I know of no way to find out whether the user revoked permissions from an app this way. You may see similar behavior on some custom ROMs that added this sort of permission control mechanism prior to Android 6.0.

Post a Comment for "How To Check What Other Apps Granted From Permissions"