Generate FakeFeatureFlagsImpl in test mode
Before FeatureFlagsImpl will be used as a fake for testing. This change
adds new class FakeFeatureFlagsImpl. The FeatureFlagsImpl will keep the
same as production. FakeFeatureFlagsImpl can be used as fake for
testing.
FakeFeatureFlagsImpl, and FeatureFlagsImpl will be generated in both
test and prod mode. In test mode FeatureFlagsImpl will just be a stub,
and in prod mode FakeFeatureFlagsImpl will just be a stub.
Bug: 280833463
Test: atest aconfig.test
Change-Id: I11c1e716a9ea00d55600e5e9d5fb6442420762e6
diff --git a/tools/aconfig/templates/Flags.java.template b/tools/aconfig/templates/Flags.java.template
index c244b15..012eba6 100644
--- a/tools/aconfig/templates/Flags.java.template
+++ b/tools/aconfig/templates/Flags.java.template
@@ -10,11 +10,11 @@
}
{{ endfor }}
{{ -if is_test_mode }}
- public static void setFeatureFlagsImpl(FeatureFlags featureFlags) \{
+ public static void setFeatureFlags(FeatureFlags featureFlags) \{
Flags.FEATURE_FLAGS = featureFlags;
}
- public static void unsetFeatureFlagsImpl() \{
+ public static void unsetFeatureFlags() \{
Flags.FEATURE_FLAGS = null;
}
{{ endif}}