Commit Graph

5 Commits

Author SHA1 Message Date
Zhi Dou
e8a4ee7288 aconfig: add exported mode in rust codegen
This commit adds exported mode to rust codegen.

When the codegen mode is exported
1. only flags with exported: true will be generated
2. the generated getter should be in a read_write format and with
   default value as false, regardless the original permission and state
   of the flag

This commit adds integration test for rust codegen exported mode.

Bug: 316357104
Test: atest aconfig.test aconfig.test_mode.test.rust aconfig.exported_mode.test.rust
Change-Id: Ib7dae666e13eb8898289b06d42a4f89326e175c4
2023-12-19 16:58:06 +00:00
Zhi Dou
b52465da31 aconfig: add new testing flag enabled_fixed_ro_exported
This commit adds a new testing flag enabled_fixed_ro_exported to test
the case of a exported and fixed_read_only flag.

Test: atest aconfig.test aconfig.test.java AconfigJavaHostTest
aconfig.test.cpp aconfig.test.cpp.test_mode aconfig.prod_mode.test.rust
Bug: 316357680

Change-Id: Iaedb8a6875166c6a6d24c7c3deee701a496b4964
2023-12-19 16:40:53 +00:00
Mårten Kongstad
b7fc0d3e16 aconfig: pass ownership of ProtoParsedFlag items to Rust codegen
Pass ownership of the ProtoParsedFlag iterator items to the Rust
codegen: this removes the need for an explicit lifetime annotation.

Bug: N/A
Test: atest aconfig.test
Change-Id: Ia37ff9f1238684ea31cda6be70acde54fdb04881
2023-12-14 13:43:12 +01:00
Oriol Prieto Gasco
bbeda85949 aconfig: Respect flag naming convention on test flags
Test: atest aconfig.test
Bug: 311152507
Change-Id: I960867d32415007db5dacab57e97b813cbbee650
2023-12-11 18:45:06 +00:00
Mårten Kongstad
12e593cd02 aconfig: move codegen into separate module
Consolidate the code generation sources into its own module. This is
done in preparation for when support for the new flag storage will be
added, which should also be placed in a separate module.

Bug: N/A
Test: atest aconfig.test aconfig.test.java
Change-Id: I8246729218ec60f2af4568c460e98329665a89fa
2023-12-08 11:24:54 +01:00