Create avf_v_test_apis aconfig flag and use it in @FlaggedApi
We are using build flags to flag-guard our features (there are multiple
reasons for it, the most simple one is - almost all of our features
add new non-trivial files to /system partition / com.android.virt APEX,
and don't want these additions to be released in a QPR).
Unfortunately, build flags are not supported in @FlaggedApi annotation.
There is a tracking bug to expose build flags as aconfig flags
(b/309090563), but it will take time to implement.
To work around these limitations, and to ensure that our api surface
additions are handled correctly during API finalization, we are adding
this avf_v_test_apis aconfig flag. The whole purpose of this flag is
just to be used in @FlaggedApi, the implementation of the features is
actually guarded by build flags. We also have a
VirtualMachine#isFeatureEnabled @TestApi that is used by CTS test to
ensure that tests are skipped on release configurations that haven't
enabled the feature yet.
Bug: 325441024
Test: m
Change-Id: I28bae128ea764bc91b52824c421a492beb2dc02f
diff --git a/Android.bp b/Android.bp
index 717c902..6e7c3c8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -89,3 +89,19 @@
tools: ["dtc"],
cmd: "FILES=($(in)) && $(location dtc) -I dts -O dtb $${FILES[-1]} -o $(out)",
}
+
+// This is a temporary workaround until b/309090563 is implemented.
+aconfig_declarations {
+ name: "avf_aconfig_flags",
+ package: "com.android.system.virtualmachine.flags",
+ srcs: [
+ "avf_flags.aconfig",
+ ],
+}
+
+java_aconfig_library {
+ name: "avf_aconfig_flags_java",
+ aconfig_declarations: "avf_aconfig_flags",
+ sdk_version: "module_current",
+ apex_available: ["com.android.virt"],
+}