List of usage examples for android.content.pm PackageManager queryPermissionsByGroup
public abstract List<PermissionInfo> queryPermissionsByGroup(String group, @PermissionInfoFlags int flags) throws NameNotFoundException;
From source file:Main.java
public static void printAllPermission(Context context) { if (!debug) { return;/* w w w . j a va 2s . c o m*/ } PackageManager pm = context.getPackageManager(); CharSequence csPermissionGroupLabel; CharSequence csPermissionLabel; List<PermissionGroupInfo> lstGroups = pm.getAllPermissionGroups(PackageManager.GET_PERMISSIONS); for (PermissionGroupInfo pgi : lstGroups) { csPermissionGroupLabel = pgi.loadLabel(pm); Log.d("ldx", "PermissionGroup: " + pgi.name + " [" + csPermissionGroupLabel.toString() + "]"); try { List<PermissionInfo> lstPermissions = pm.queryPermissionsByGroup(pgi.name, 0); for (PermissionInfo pi : lstPermissions) { csPermissionLabel = pi.loadLabel(pm); Log.d("ldx", " PermissionChild" + pi.name + " [" + csPermissionLabel.toString() + "]"); } } catch (Exception ex) { ex.printStackTrace(); } } }