Add bootclasspath_fragment.

Note that the contents of the bootclasspath_fragment are added as
dependencies to an apex, so there is no need to duplicate them in
java_libs.

Bug: 180105615
Test: atest CtsClasspathsTestCases
Change-Id: Ibbedc8e4b15801f4a11e3155c453db0e51944995
diff --git a/apex/Android.bp b/apex/Android.bp
index 64f8a25..6dd3329 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -23,6 +23,7 @@
 }
 
 apex_defaults {
+    bootclasspath_fragments: ["com.android.os.statsd-bootclasspath-fragment"],
     jni_libs: [
         "libstats_jni",
     ],
@@ -32,7 +33,6 @@
     ],
     binaries: ["statsd"],
     java_libs: [
-        "framework-statsd",
         "service-statsd",
     ],
     compile_multilib: "both",
@@ -86,3 +86,10 @@
         "libstatssocket",
     ],
 }
+
+// Encapsulate the contributions made by the com.android.os.statsd to the bootclasspath.
+bootclasspath_fragment {
+    name: "com.android.os.statsd-bootclasspath-fragment",
+    contents: ["framework-statsd"],
+    apex_available: ["com.android.os.statsd"],
+}