Expose setShouldUseHugepages to @SystemApi
Bug: 383347947
Test: atest MicrodroidTests
Change-Id: I5f525833e78a44ff254b7e0ec5ff570579e068bd
diff --git a/build/Android.bp b/build/Android.bp
index 2b97927..ef70fe4 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -75,3 +75,20 @@
tools: ["dtc"],
cmd: "FILES=($(in)) && $(location dtc) -@ -I dts -O dtb $${FILES[-1]} -o $(out)",
}
+
+// This is a temporary workaround until b/343795511 is implemented.
+aconfig_declarations {
+ name: "avf_aconfig_flags",
+ package: "com.android.system.virtualmachine.flags",
+ container: "com.android.virt",
+ 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"],
+}
diff --git a/build/avf_flags.aconfig b/build/avf_flags.aconfig
new file mode 100644
index 0000000..9815c60
--- /dev/null
+++ b/build/avf_flags.aconfig
@@ -0,0 +1,11 @@
+package: "com.android.system.virtualmachine.flags"
+container: "com.android.virt"
+
+flag {
+ name: "promote_set_should_use_hugepages_to_system_api"
+ is_exported: true
+ namespace: "virtualization"
+ description: "Flag used in @FlaggedApi annotation for setShouldUseHugepages"
+ bug: "383347947"
+ is_fixed_read_only: true
+}