コード例 #1
0
  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();
  }
コード例 #2
0
 @Override
 public void resetRequestedPermissions(List<String> requested) {
   this.requestedPermissions = new TreeSet<String>(requested);
   save();
 }