code: public static String permissionToString(final int iPermission) {
      int permission = iPermission;
      final StringBuilder returnValue = new StringBuilder();
      for (Entry<Integer, String> p : PERMISSION_BIT_NAMES.entrySet()) {
        if ((permission & p.getKey()) == p.getKey()) {
          if (returnValue.length() > 0)
            returnValue.append(", ");
          returnValue.append(p.getValue());
          permission &= ~p.getKey();
        }
      }
      if (permission != 0) {
        if (returnValue.length() > 0)
          returnValue.append(", ");
        returnValue.append("Unknown 0x");
        returnValue.append(Integer.toHexString(permission));
      }
  
      return returnValue.toString();
    }
docs: Convert the permission code to a readable string.
  
  @param iPermission
  Permission to convert
  @return String representation of the permission