Switch ResourceTable to use ResourceNamedType instead of ResourceType.
DD: go/custom-resource-types-in-aapt2
Bug: b/215108200
Test: existing
Change-Id: If9ddcd529dff66c8ec4238f56ab64391c2f44c28
diff --git a/tools/aapt2/link/PrivateAttributeMover.cpp b/tools/aapt2/link/PrivateAttributeMover.cpp
index 675b02a..8c6c743 100644
--- a/tools/aapt2/link/PrivateAttributeMover.cpp
+++ b/tools/aapt2/link/PrivateAttributeMover.cpp
@@ -57,7 +57,7 @@
bool PrivateAttributeMover::Consume(IAaptContext* context, ResourceTable* table) {
for (auto& package : table->packages) {
- ResourceTableType* type = package->FindType(ResourceType::kAttr);
+ ResourceTableType* type = package->FindTypeWithDefaultName(ResourceType::kAttr);
if (!type) {
continue;
}
@@ -80,7 +80,8 @@
continue;
}
- ResourceTableType* priv_attr_type = package->FindOrCreateType(ResourceType::kAttrPrivate);
+ auto attr_private_type = ResourceNamedTypeWithDefaultName(ResourceType::kAttrPrivate);
+ ResourceTableType* priv_attr_type = package->FindOrCreateType(attr_private_type);
CHECK(priv_attr_type->entries.empty());
priv_attr_type->entries = std::move(private_attr_entries);
}