Luke
Luke

Reputation: 18973

Why is PackageInfo.requestedPermissions always null?

I'm trying to enumerate all the permissions used by all the installed packages, however when I check the requestedPermissions property for each of my installed packages it is always null.

Upvotes: 3

Views: 2443

Answers (1)

Luke
Luke

Reputation: 18973

I just needed to pass the PackageManager.GET_PERMISSIONS flag to getInstalledPackages(). Here is a code snippet.

getPackageManager().getInstalledPackages(PackageManager.GET_PERMISSIONS);

Upvotes: 3

Related Questions