Move AVF jar to BCP and rename it to framework-virtualization
In Android U we are planning to provide privileged @SystemApi's to
manage virtual machines. These APIs will be provided by the
framework-virtualization jar.
This change moves the framework-virtualization jar to be part of
the BCP, which will allow us to use the processes and guidelines setup
for Android APIs.
This change also renames the java_sdk_library to framework-virtualization
to align it with other BCP jars provided by APEX modules.
Bug: 243512044
Test: build on product with AVF support
Test: build on product without AVF support
Test: atest --test-mapping packages/modules/Virtualization:avf-presubmit
Change-Id: Ifb0d04d58bb7e18fe548ab3780a0d753c8baba2d
diff --git a/apex/Android.bp b/apex/Android.bp
index ef7677b..2d6c757 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -53,6 +53,10 @@
file_contexts: ":com.android.virt-file_contexts",
canned_fs_config: "canned_fs_config",
+
+ bootclasspath_fragments: [
+ "com.android.virt-bootclasspath-fragment",
+ ],
}
apex_defaults {
@@ -83,9 +87,6 @@
"fd_server",
"vm",
],
- java_libs: [
- "android.system.virtualmachine",
- ],
jni_libs: [
"libvirtualmachine_jni",
],
@@ -207,3 +208,43 @@
},
},
}
+
+// Encapsulate the contributions made by the com.android.virt to the bootclasspath.
+bootclasspath_fragment {
+ name: "com.android.virt-bootclasspath-fragment",
+ contents: ["framework-virtualization"],
+ apex_available: ["com.android.virt"],
+
+ // The bootclasspath_fragments that provide APIs on which this depends.
+ fragments: [
+ {
+ apex: "com.android.art",
+ module: "art-bootclasspath-fragment",
+ },
+ ],
+
+ // Additional stubs libraries that this fragment's contents use which are
+ // not provided by another bootclasspath_fragment.
+ additional_stubs: [
+ "android-non-updatable",
+ ],
+
+ hidden_api: {
+
+ // This module does not contain any split packages.
+ split_packages: [],
+
+ // The following packages and all their subpackages currently only
+ // contain classes from this bootclasspath_fragment. Listing a package
+ // here won't prevent other bootclasspath modules from adding classes in
+ // any of those packages but it will prevent them from adding those
+ // classes into an API surface, e.g. public, system, etc.. Doing so will
+ // result in a build failure due to inconsistent flags.
+ package_prefixes: [
+ "android.system.virtualmachine",
+ "android.system.virtualizationservice",
+ // android.sysprop.*, renamed by jarjar
+ "com.android.system.virtualmachine.sysprop",
+ ],
+ },
+}