Merge "Reuse Java flag name constants in FeatureFlagsImpl" into main

This commit is contained in:
Jared Duke
2024-07-03 14:53:29 +00:00
committed by Gerrit Code Review
2 changed files with 8 additions and 8 deletions

View File

@@ -505,11 +505,11 @@ mod tests {
try { try {
Properties properties = DeviceConfig.getProperties("aconfig_test"); Properties properties = DeviceConfig.getProperties("aconfig_test");
disabledRw = disabledRw =
properties.getBoolean("com.android.aconfig.test.disabled_rw", false); properties.getBoolean(Flags.FLAG_DISABLED_RW, false);
disabledRwExported = disabledRwExported =
properties.getBoolean("com.android.aconfig.test.disabled_rw_exported", false); properties.getBoolean(Flags.FLAG_DISABLED_RW_EXPORTED, false);
enabledRw = enabledRw =
properties.getBoolean("com.android.aconfig.test.enabled_rw", true); properties.getBoolean(Flags.FLAG_ENABLED_RW, true);
} catch (NullPointerException e) { } catch (NullPointerException e) {
throw new RuntimeException( throw new RuntimeException(
"Cannot read value from namespace aconfig_test " "Cannot read value from namespace aconfig_test "
@@ -527,7 +527,7 @@ mod tests {
try { try {
Properties properties = DeviceConfig.getProperties("other_namespace"); Properties properties = DeviceConfig.getProperties("other_namespace");
disabledRwInOtherNamespace = disabledRwInOtherNamespace =
properties.getBoolean("com.android.aconfig.test.disabled_rw_in_other_namespace", false); properties.getBoolean(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, false);
} catch (NullPointerException e) { } catch (NullPointerException e) {
throw new RuntimeException( throw new RuntimeException(
"Cannot read value from namespace other_namespace " "Cannot read value from namespace other_namespace "
@@ -700,11 +700,11 @@ mod tests {
try { try {
Properties properties = DeviceConfig.getProperties("aconfig_test"); Properties properties = DeviceConfig.getProperties("aconfig_test");
disabledRwExported = disabledRwExported =
properties.getBoolean("com.android.aconfig.test.disabled_rw_exported", false); properties.getBoolean(Flags.FLAG_DISABLED_RW_EXPORTED, false);
enabledFixedRoExported = enabledFixedRoExported =
properties.getBoolean("com.android.aconfig.test.enabled_fixed_ro_exported", false); properties.getBoolean(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, false);
enabledRoExported = enabledRoExported =
properties.getBoolean("com.android.aconfig.test.enabled_ro_exported", false); properties.getBoolean(Flags.FLAG_ENABLED_RO_EXPORTED, false);
} catch (NullPointerException e) { } catch (NullPointerException e) {
throw new RuntimeException( throw new RuntimeException(
"Cannot read value from namespace aconfig_test " "Cannot read value from namespace aconfig_test "

View File

@@ -27,7 +27,7 @@ public final class FeatureFlagsImpl implements FeatureFlags \{
{{ -for flag in namespace_with_flags.flags }} {{ -for flag in namespace_with_flags.flags }}
{{ -if flag.is_read_write }} {{ -if flag.is_read_write }}
{flag.method_name} = {flag.method_name} =
properties.getBoolean("{flag.device_config_flag}", {flag.default_value}); properties.getBoolean(Flags.FLAG_{flag.flag_name_constant_suffix}, {flag.default_value});
{{ -endif }} {{ -endif }}
{{ -endfor }} {{ -endfor }}
} catch (NullPointerException e) \{ } catch (NullPointerException e) \{