Merge "Generate and check the api.txt file for intra core api"
diff --git a/mmodules/intracoreapi/Android.bp b/mmodules/intracoreapi/Android.bp
index e3b607c..d3fb3e1 100644
--- a/mmodules/intracoreapi/Android.bp
+++ b/mmodules/intracoreapi/Android.bp
@@ -24,11 +24,24 @@
     no_standard_libs: true,
     libs: ["core-all"],
 
-    api_filename: "api.txt",
     installable: false,
     args: "--hide-annotation libcore.api.Hide "
         + "--show-single-annotation libcore.api.IntraCoreApi",
     merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],
+
+    api_filename: "api.txt",
+    removed_api_filename: "removed.txt",
+    previous_api: "previous.txt",
+    check_api: {
+        current: {
+            api_file: "api/intra/current-api.txt",
+            removed_api_file: "api/intra/current-removed.txt",
+        },
+        last_released: {
+            api_file: "api/intra/last-api.txt",
+            removed_api_file: "api/intra/last-removed.txt",
+        },
+    },
 }
 
 // A library containing the {public SDK + intra-core} API stubs for the
diff --git a/mmodules/intracoreapi/api/intra/current-api.txt b/mmodules/intracoreapi/api/intra/current-api.txt
new file mode 100644
index 0000000..e537383
--- /dev/null
+++ b/mmodules/intracoreapi/api/intra/current-api.txt
@@ -0,0 +1,129 @@
+package android.system {
+
+  public final class ErrnoException extends java.lang.Exception {
+    method public java.net.SocketException rethrowAsSocketException() throws java.net.SocketException;
+  }
+
+  public final class StructTimeval {
+    method public static android.system.StructTimeval fromMillis(long);
+    method public long toMillis();
+    field public final long tv_sec;
+    field public final long tv_usec;
+  }
+
+}
+
+package dalvik.system {
+
+  public final class BlockGuard {
+    method public static dalvik.system.BlockGuard.Policy getThreadPolicy();
+  }
+
+  public static abstract interface BlockGuard.Policy {
+    method public abstract int getPolicyMask();
+    method public abstract void onExplicitGc();
+    method public abstract void onNetwork();
+    method public abstract void onReadFromDisk();
+    method public abstract void onUnbufferedIO();
+    method public abstract void onWriteToDisk();
+  }
+
+  public final class CloseGuard {
+    method public void close();
+    method public static dalvik.system.CloseGuard get();
+    method public void open(java.lang.String);
+    method public void warnIfOpen();
+  }
+
+}
+
+package java.net {
+
+  public class InetAddress implements java.io.Serializable {
+    method public static boolean isNumeric(java.lang.String);
+  }
+
+  public class Socket implements java.io.Closeable {
+    method public java.io.FileDescriptor getFileDescriptor$();
+  }
+
+}
+
+package java.security.spec {
+
+  public class ECParameterSpec implements java.security.spec.AlgorithmParameterSpec {
+    method public java.lang.String getCurveName();
+    method public void setCurveName(java.lang.String);
+  }
+
+}
+
+package libcore.api {
+
+  public abstract class IntraCoreApi implements java.lang.annotation.Annotation {
+  }
+
+}
+
+package libcore.io {
+
+  public final class IoUtils {
+    method public static void closeQuietly(java.lang.AutoCloseable);
+  }
+
+  public final class Libcore {
+    field public static libcore.io.Os os;
+  }
+
+  public abstract interface Os {
+    method public abstract void setsockoptTimeval(java.io.FileDescriptor, int, int, android.system.StructTimeval) throws android.system.ErrnoException;
+  }
+
+}
+
+package libcore.mmodule.libart {
+
+  public class DemoLibartClass {
+    method public static java.lang.String intraCoreDependencyMethod();
+    method public static java.lang.String simpleMethod();
+  }
+
+}
+
+package libcore.mmodule.simple {
+
+  public class DemoSimpleClass {
+    method public static java.lang.String intraCoreDependencyMethod();
+    method public static java.lang.String simpleMethod();
+  }
+
+}
+
+package libcore.net {
+
+  public abstract class NetworkSecurityPolicy {
+    ctor public NetworkSecurityPolicy();
+    method public static libcore.net.NetworkSecurityPolicy getInstance();
+    method public abstract boolean isCertificateTransparencyVerificationRequired(java.lang.String);
+  }
+
+}
+
+package sun.security.util {
+
+  public abstract interface DerEncoder {
+    method public abstract void derEncode(java.io.OutputStream) throws java.io.IOException;
+  }
+
+}
+
+package sun.security.x509 {
+
+  public class AlgorithmId implements sun.security.util.DerEncoder java.io.Serializable {
+    method public void derEncode(java.io.OutputStream) throws java.io.IOException;
+    method public static sun.security.x509.AlgorithmId get(java.lang.String) throws java.security.NoSuchAlgorithmException;
+    method public java.lang.String getName();
+  }
+
+}
+
diff --git a/mmodules/intracoreapi/api/intra/current-removed.txt b/mmodules/intracoreapi/api/intra/current-removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/mmodules/intracoreapi/api/intra/current-removed.txt
diff --git a/mmodules/intracoreapi/api/intra/last-api.txt b/mmodules/intracoreapi/api/intra/last-api.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/mmodules/intracoreapi/api/intra/last-api.txt
diff --git a/mmodules/intracoreapi/api/intra/last-removed.txt b/mmodules/intracoreapi/api/intra/last-removed.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/mmodules/intracoreapi/api/intra/last-removed.txt