Add is_exported field to aconfig.proto
When a flag is exported, it can be read by code built in other containers. By
default flags are not exported. Set this to true if your flag is gating
a public API which may be called from other containers (typically, a
flag used in @FlaggedAPI annotations).
Test: atest aconfig.test
Bug: 311152500
Change-Id: I53e3ed18b96c1518f04172d5933ef96b41ccda7e
diff --git a/tools/aconfig/src/protos.rs b/tools/aconfig/src/protos.rs
index d3b5b37..a5a5342 100644
--- a/tools/aconfig/src/protos.rs
+++ b/tools/aconfig/src/protos.rs
@@ -308,6 +308,7 @@
namespace: "first_ns"
description: "This is the description of the first flag."
bug: "123"
+ is_exported: true
}
flag {
name: "second"
@@ -326,12 +327,14 @@
assert_eq!(first.description(), "This is the description of the first flag.");
assert_eq!(first.bug, vec!["123"]);
assert!(!first.is_fixed_read_only());
+ assert!(first.is_exported());
let second = flag_declarations.flag.iter().find(|pf| pf.name() == "second").unwrap();
assert_eq!(second.name(), "second");
assert_eq!(second.namespace(), "second_ns");
assert_eq!(second.description(), "This is the description of the second flag.");
assert_eq!(second.bug, vec!["abc"]);
assert!(second.is_fixed_read_only());
+ assert!(!second.is_exported());
// bad input: missing package in flag declarations
let error = flag_declarations::try_from_text_proto(