[aapt2] Ignore annotations in flag/enum attribute values
Bug: 258855262
Test: atest aapt2_tests
Change-Id: If67a73b02da719b049c19cee561a2f9b8945956b
diff --git a/tools/aapt2/test/Builders.cpp b/tools/aapt2/test/Builders.cpp
index 65f63dc..b5934e4 100644
--- a/tools/aapt2/test/Builders.cpp
+++ b/tools/aapt2/test/Builders.cpp
@@ -177,12 +177,25 @@
return *this;
}
+AttributeBuilder& AttributeBuilder::SetComment(StringPiece comment) {
+ attr_->SetComment(comment);
+ return *this;
+}
+
AttributeBuilder& AttributeBuilder::AddItem(StringPiece name, uint32_t value) {
attr_->symbols.push_back(
Attribute::Symbol{Reference(ResourceName({}, ResourceType::kId, name)), value});
return *this;
}
+AttributeBuilder& AttributeBuilder::AddItemWithComment(StringPiece name, uint32_t value,
+ StringPiece comment) {
+ Reference ref(ResourceName({}, ResourceType::kId, name));
+ ref.SetComment(comment);
+ attr_->symbols.push_back(Attribute::Symbol{ref, value});
+ return *this;
+}
+
std::unique_ptr<Attribute> AttributeBuilder::Build() {
return std::move(attr_);
}