I would like to retrieve the list of all permissions required by the application (as defined in AndroidManifest.xml). The list should include also permissions that were disabled(or just not enabled) by the user. Is it possible?
You can just query the package manager for this info
PackageManager p = context.getPackageManager();
PackageInfo pi = p.getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
String[] permissions = pi.requestedPermissions;
int[] permissionStatus = pi.requestedPermissionsFlags;
for permissions that are granted, you'll have the int
equals REQUESTED_PERMISSION_GRANTED
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.