code: public static boolean isServiceEnabled(final XMPPConnection connection) {
          ServiceDiscoveryManager manager = ServiceDiscoveryManager
                  .getInstanceFor(connection);
  
          List<String> namespaces = new ArrayList<>();
          namespaces.addAll(Arrays.asList(NAMESPACE));
          namespaces.add(DataPacketExtension.NAMESPACE);
          if (!IBB_ONLY) {
              namespaces.add(Bytestream.NAMESPACE);
          }
  
          for (String namespace : namespaces) {
              if (!manager.includesFeature(namespace)) {
                  return false;
              }
          }
          return true;
      }
docs: Checks to see if all file transfer related services are enabled on the
  connection.
  
  @param connection The connection to check
  @return True if all related services are enabled, false if they are not.