As @CommonsWare commented, PackageInfo.requestedPermissions contains an "Array of all <uses-permission>
tags included under <manifest>
, or null if there were none."
I've tested this on a device running Android M, and the output I got included the permissions from all <uses-permission>
tags regardless of whether those permissions had been granted or not, just as expected.
A minimal example for testing this:
try {
PackageInfo pi = getPackageManager().getPackageInfo("com.example.foo", PackageManager.GET_PERMISSIONS);
for (String perm : pi.requestedPermissions) {
Log.e("Foo", perm);
}
} catch (Exception e) {
}