文章目录
  1. 1. 判断应用是否有某个权限
  2. 2. 获取某个应用的权限清单

判断应用是否有某个权限

1
2
PackageManager pm = getPackageManager();
boolean permission = (PackageManager.PERMISSION_GRANTED == pm.checkPermission("android.permission.RECORD_AUIO","packageName"));// permission用于判断是否有该权限

获取某个应用的权限清单

1
2
PackageInfo pack = pm.getPackageInfo("packageName",PackageManager.GET_PERMISSIONS);
String[] permissionStrings = pack.requestedPermissions; // 获取到应用权限的字符串数组
文章目录
  1. 1. 判断应用是否有某个权限
  2. 2. 获取某个应用的权限清单