Add a new field to the proto messages flag_declaration and parsed_flag. The new field will be used verbatim as a parameter when calling DeviceConfig.getBoolean to read the value of a READ_WRITE flag. See the DeviceConfig API for more info. Note: not to be confused with the old namespace field, which has been renamed to package. Bug: 285211724 Test: atest aconfig.test Change-Id: I2181be7b5e98fc334e5277fb5f7e386f1fe0b550
20 lines
510 B
Plaintext
20 lines
510 B
Plaintext
package {package};
|
|
{{ if readwrite }}
|
|
import android.provider.DeviceConfig;
|
|
{{ endif }}
|
|
public final class Flags \{
|
|
{{ for item in class_elements}}
|
|
public static boolean {item.method_name}() \{
|
|
{{ if item.readwrite- }}
|
|
return DeviceConfig.getBoolean(
|
|
"{item.device_config_namespace}",
|
|
"{item.device_config_flag}",
|
|
{item.default_value}
|
|
);
|
|
{{ -else- }}
|
|
return {item.default_value};
|
|
{{ -endif }}
|
|
}
|
|
{{ endfor }}
|
|
}
|