Add a readonly version for flags in libcore
Bug: 368409430
Flag: EXEMPT bugfix
The exported flag native_metrics from com.android.libcore breaks
some use cases of Isolated Process as reading of the flag requires
I/O permission which Isolated Processes don't have. In this CL,
we added a readonly version of the flags in libcore, and use
`force-read-only` mode, the resulting generated code will return
the values hardcoded. This prevents reading of the flag value
from storage, and thus allows Isolated Process to work.
Access to the flag will be done by:
com.android.libcore.readonly.Flags.nativeMetrics()
com.android.libcore.readonly.Flags.postCleanupApis()
This readonly flags will be kept to be synced with the one in libcore.
Once the new aconfig API is landed, there will be no need to keep the
readonly version, and thus this CL can be reverted.
Change-Id: If4c56dae63be879b54f951bb8c7904ca3b98607e
diff --git a/libcore-readonly.aconfig b/libcore-readonly.aconfig
new file mode 100644
index 0000000..3cda92c
--- /dev/null
+++ b/libcore-readonly.aconfig
@@ -0,0 +1,25 @@
+package: "com.android.libcore.readonly"
+container: "system"
+
+# These are the read-only version of the aconfig flags in com.android.libcore
+# that will be built with 'force-read-only' mode.
+# See b/368409430 - these flags will be removed once the new aconfig API landed.
+flag {
+ namespace: "core_libraries"
+ name: "post_cleanup_apis"
+ is_exported: false
+ description: "This flag includes APIs to add/remove/call callbacks post-cleanup"
+ bug: "331243037"
+ # APIs provided by a mainline module can only use a frozen flag.
+ is_fixed_read_only: true
+}
+
+flag {
+ namespace: "core_libraries"
+ name: "native_metrics"
+ is_exported: false
+ description: "This flag includes APIs fo maintaining and exposing native allocation metrics"
+ bug: "331243037"
+ # APIs provided by a mainline module can only use a frozen flag.
+ is_fixed_read_only: true
+}