aconfig: Add exported mode to aconfig Java library generation.
This commit adds a third codegen mode, _exported_, in addition to the existing modes, production and test. When codegen mode is _exported_, getters are generated _only_ for flags marked as exported as well. Also the getters always look up DeviceConfig values at runtime, and have a default value of false. This only implements exported mode for Java codegen, follow-up CLs will support Rust and C++. Test: atest aconfig.test Bug: 311152507 Change-Id: Ie39379b40de072180e05d84c76361b24cc0e0d83
This commit is contained in:
@@ -12,11 +12,23 @@ public class FakeFeatureFlagsImpl implements FeatureFlags \{
|
||||
}
|
||||
|
||||
{{ for item in flag_elements}}
|
||||
{{ if library_exported }}
|
||||
|
||||
{{ if item.exported }}
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public boolean {item.method_name}() \{
|
||||
return getValue(Flags.FLAG_{item.flag_name_constant_suffix});
|
||||
}
|
||||
{{ endif }}
|
||||
|
||||
{{ else }}
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public boolean {item.method_name}() \{
|
||||
return getValue(Flags.FLAG_{item.flag_name_constant_suffix});
|
||||
}
|
||||
{{ endif }}
|
||||
{{ endfor}}
|
||||
public void setFlag(String flagName, boolean value) \{
|
||||
if (!this.mFlagMap.containsKey(flagName)) \{
|
||||
|
Reference in New Issue
Block a user