Merge "Add is_exported field to aconfig.proto" into main am: c96bf2caec
Original change: https://android-review.googlesource.com/c/platform/build/+/2838715 Change-Id: I8a393e11e624798ce757818fb17709fc36ef86d5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
ddff40facb
@@ -40,6 +40,7 @@ message flag_declaration {
|
|||||||
optional string description = 3;
|
optional string description = 3;
|
||||||
repeated string bug = 4;
|
repeated string bug = 4;
|
||||||
optional bool is_fixed_read_only = 5;
|
optional bool is_fixed_read_only = 5;
|
||||||
|
optional bool is_exported = 6;
|
||||||
};
|
};
|
||||||
|
|
||||||
message flag_declarations {
|
message flag_declarations {
|
||||||
@@ -77,6 +78,8 @@ message parsed_flag {
|
|||||||
optional flag_permission permission = 7;
|
optional flag_permission permission = 7;
|
||||||
repeated tracepoint trace = 8;
|
repeated tracepoint trace = 8;
|
||||||
optional bool is_fixed_read_only = 9;
|
optional bool is_fixed_read_only = 9;
|
||||||
|
optional bool is_exported = 10;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message parsed_flags {
|
message parsed_flags {
|
||||||
|
@@ -98,6 +98,7 @@ pub fn parse_flags(
|
|||||||
};
|
};
|
||||||
parsed_flag.set_permission(flag_permission);
|
parsed_flag.set_permission(flag_permission);
|
||||||
parsed_flag.set_is_fixed_read_only(flag_declaration.is_fixed_read_only());
|
parsed_flag.set_is_fixed_read_only(flag_declaration.is_fixed_read_only());
|
||||||
|
parsed_flag.set_is_exported(flag_declaration.is_exported());
|
||||||
let mut tracepoint = ProtoTracepoint::new();
|
let mut tracepoint = ProtoTracepoint::new();
|
||||||
tracepoint.set_source(input.source.clone());
|
tracepoint.set_source(input.source.clone());
|
||||||
tracepoint.set_state(DEFAULT_FLAG_STATE);
|
tracepoint.set_state(DEFAULT_FLAG_STATE);
|
||||||
|
@@ -308,6 +308,7 @@ flag {
|
|||||||
namespace: "first_ns"
|
namespace: "first_ns"
|
||||||
description: "This is the description of the first flag."
|
description: "This is the description of the first flag."
|
||||||
bug: "123"
|
bug: "123"
|
||||||
|
is_exported: true
|
||||||
}
|
}
|
||||||
flag {
|
flag {
|
||||||
name: "second"
|
name: "second"
|
||||||
@@ -326,12 +327,14 @@ flag {
|
|||||||
assert_eq!(first.description(), "This is the description of the first flag.");
|
assert_eq!(first.description(), "This is the description of the first flag.");
|
||||||
assert_eq!(first.bug, vec!["123"]);
|
assert_eq!(first.bug, vec!["123"]);
|
||||||
assert!(!first.is_fixed_read_only());
|
assert!(!first.is_fixed_read_only());
|
||||||
|
assert!(first.is_exported());
|
||||||
let second = flag_declarations.flag.iter().find(|pf| pf.name() == "second").unwrap();
|
let second = flag_declarations.flag.iter().find(|pf| pf.name() == "second").unwrap();
|
||||||
assert_eq!(second.name(), "second");
|
assert_eq!(second.name(), "second");
|
||||||
assert_eq!(second.namespace(), "second_ns");
|
assert_eq!(second.namespace(), "second_ns");
|
||||||
assert_eq!(second.description(), "This is the description of the second flag.");
|
assert_eq!(second.description(), "This is the description of the second flag.");
|
||||||
assert_eq!(second.bug, vec!["abc"]);
|
assert_eq!(second.bug, vec!["abc"]);
|
||||||
assert!(second.is_fixed_read_only());
|
assert!(second.is_fixed_read_only());
|
||||||
|
assert!(!second.is_exported());
|
||||||
|
|
||||||
// bad input: missing package in flag declarations
|
// bad input: missing package in flag declarations
|
||||||
let error = flag_declarations::try_from_text_proto(
|
let error = flag_declarations::try_from_text_proto(
|
||||||
|
@@ -42,6 +42,7 @@ parsed_flag {
|
|||||||
permission: READ_ONLY
|
permission: READ_ONLY
|
||||||
}
|
}
|
||||||
is_fixed_read_only: false
|
is_fixed_read_only: false
|
||||||
|
is_exported: false
|
||||||
}
|
}
|
||||||
parsed_flag {
|
parsed_flag {
|
||||||
package: "com.android.aconfig.test"
|
package: "com.android.aconfig.test"
|
||||||
@@ -57,6 +58,7 @@ parsed_flag {
|
|||||||
permission: READ_WRITE
|
permission: READ_WRITE
|
||||||
}
|
}
|
||||||
is_fixed_read_only: false
|
is_fixed_read_only: false
|
||||||
|
is_exported: true
|
||||||
}
|
}
|
||||||
parsed_flag {
|
parsed_flag {
|
||||||
package: "com.android.aconfig.test"
|
package: "com.android.aconfig.test"
|
||||||
@@ -77,6 +79,7 @@ parsed_flag {
|
|||||||
permission: READ_WRITE
|
permission: READ_WRITE
|
||||||
}
|
}
|
||||||
is_fixed_read_only: false
|
is_fixed_read_only: false
|
||||||
|
is_exported: false
|
||||||
}
|
}
|
||||||
parsed_flag {
|
parsed_flag {
|
||||||
package: "com.android.aconfig.test"
|
package: "com.android.aconfig.test"
|
||||||
@@ -97,6 +100,7 @@ parsed_flag {
|
|||||||
permission: READ_ONLY
|
permission: READ_ONLY
|
||||||
}
|
}
|
||||||
is_fixed_read_only: true
|
is_fixed_read_only: true
|
||||||
|
is_exported: false
|
||||||
}
|
}
|
||||||
parsed_flag {
|
parsed_flag {
|
||||||
package: "com.android.aconfig.test"
|
package: "com.android.aconfig.test"
|
||||||
@@ -122,6 +126,7 @@ parsed_flag {
|
|||||||
permission: READ_ONLY
|
permission: READ_ONLY
|
||||||
}
|
}
|
||||||
is_fixed_read_only: false
|
is_fixed_read_only: false
|
||||||
|
is_exported: false
|
||||||
}
|
}
|
||||||
parsed_flag {
|
parsed_flag {
|
||||||
package: "com.android.aconfig.test"
|
package: "com.android.aconfig.test"
|
||||||
@@ -142,6 +147,7 @@ parsed_flag {
|
|||||||
permission: READ_WRITE
|
permission: READ_WRITE
|
||||||
}
|
}
|
||||||
is_fixed_read_only: false
|
is_fixed_read_only: false
|
||||||
|
is_exported: false
|
||||||
}
|
}
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@ flag {
|
|||||||
namespace: "aconfig_test"
|
namespace: "aconfig_test"
|
||||||
description: "This flag is DISABLED + READ_WRITE"
|
description: "This flag is DISABLED + READ_WRITE"
|
||||||
bug: "456"
|
bug: "456"
|
||||||
|
is_exported: true
|
||||||
}
|
}
|
||||||
|
|
||||||
# This flag's final value calculated from:
|
# This flag's final value calculated from:
|
||||||
|
Reference in New Issue
Block a user