List of usage examples for android.content.pm PackageManager getAllPermissionGroups
public abstract List<PermissionGroupInfo> getAllPermissionGroups(@PermissionGroupInfoFlags int flags);
From source file:Main.java
public static void printAllPermission(Context context) { if (!debug) { return;//from w w w . j a v a2 s . 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(); } } }