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 setRequestedPermissions(List<String> requested, boolean set) { for (String oneRequested : requested) { setRequestedPermission(oneRequested, set); } }
@Override public void setRequestedPermission(String requested, boolean set) { setRequestedPermission(requested, set, true); }