private void setRequestedPermission(String requested, boolean set, boolean setSubPermissions) { if (requested == null) { return; } if (set) { requestedPermissions.add(requested); if (setSubPermissions) { List<String> subPermissions = getAvailablePermissions(requested); requestedPermissions.addAll(subPermissions); } } else { requestedPermissions.remove(requested); if (setSubPermissions) { List<String> subPermissions = getAvailablePermissions(requested); requestedPermissions.removeAll(subPermissions); } } String parentPermission = Util.getParentKey(requested); setRequestedPermission(parentPermission, allSubPermissionsSet(parentPermission), false); save(); }
@Override public void resetRequestedPermissions(List<String> requested) { this.requestedPermissions = new TreeSet<String>(requested); save(); }