code: public static boolean isServiceEnabled(XMPPConnection connection) {
          connection.getXMPPServiceDomain();
          return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(AMPExtension.NAMESPACE);
      }
docs: Returns true if the AMP support is enabled for the given connection.
  
  @param connection the connection to look for AMP support
  @return a boolean indicating if the AMP support is enabled for the given connection