Add setFlag and resetAll in FeatureFlags test mode
Add methods setFlag and resetAll in FeatureFlags in test mode. For the
injection usecase, user will use the interface FeatureFlags in the code
to control the flags.
Add tests for test mode.
Bug: 280833463
Test: Atest AconfigJavaHostTest --host
Change-Id: Ib59ba35a9011a6400af42fc9c283d37193577997
diff --git a/tools/aconfig/templates/FeatureFlagsImpl.java.template b/tools/aconfig/templates/FeatureFlagsImpl.java.template
index ba86ce5..7e1eb15 100644
--- a/tools/aconfig/templates/FeatureFlagsImpl.java.template
+++ b/tools/aconfig/templates/FeatureFlagsImpl.java.template
@@ -29,5 +29,16 @@
"Method is not implemented.");
}
{{ endfor- }}
+ @Override
+ public void setFlag(String flagName, boolean value) \{
+ throw new UnsupportedOperationException(
+ "Method is not implemented.");
+ }
+
+ @Override
+ public void resetAll() \{
+ throw new UnsupportedOperationException(
+ "Method is not implemented.");
+ }
}
{{ endif }}