diff options
Diffstat (limited to 'tools/aapt2/process/SymbolTable.cpp')
-rw-r--r-- | tools/aapt2/process/SymbolTable.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/tools/aapt2/process/SymbolTable.cpp b/tools/aapt2/process/SymbolTable.cpp index ef2e448b68b8..70efbf5d17b2 100644 --- a/tools/aapt2/process/SymbolTable.cpp +++ b/tools/aapt2/process/SymbolTable.cpp @@ -114,16 +114,6 @@ const SymbolTable::Symbol* SymbolTable::FindByName(const ResourceName& name) { return shared_symbol.get(); } -const SymbolTable::Symbol* SymbolTable::FindByNameInAnyPackage(const ResourceName& name) { - for (auto& source : sources_) { - std::string package = source->GetPackageForSymbol(name); - if (!package.empty()) { - return FindByName(ResourceName(package, name.type, name.entry)); - } - } - return {}; -} - const SymbolTable::Symbol* SymbolTable::FindById(const ResourceId& id) { if (const std::shared_ptr<Symbol>& s = id_cache_.get(id)) { return s.get(); @@ -204,6 +194,7 @@ std::unique_ptr<SymbolTable::Symbol> ResourceTableSymbolSource::FindByName( if (sr.package->id && sr.type->id && sr.entry->id) { symbol->id = ResourceId(sr.package->id.value(), sr.type->id.value(), sr.entry->id.value()); + symbol->is_dynamic = (sr.package->id.value() == 0); } if (name.type == ResourceType::kAttr || name.type == ResourceType::kAttrPrivate) { @@ -221,25 +212,6 @@ std::unique_ptr<SymbolTable::Symbol> ResourceTableSymbolSource::FindByName( return symbol; } -std::string ResourceTableSymbolSource::GetPackageForSymbol(const ResourceName& name) { - for (auto& package : table_->packages) { - ResourceTableType* type = package->FindType(name.type); - if (type == nullptr) { - continue; - } - ResourceEntry* entry = type->FindEntry(name.entry); - if (entry == nullptr) { - continue; - } - return package->name; - } - if (name.type == ResourceType::kAttr) { - // Recurse and try looking up a private attribute. - return GetPackageForSymbol(ResourceName(name.package, ResourceType::kAttrPrivate, name.entry)); - } - return {}; -} - bool AssetManagerSymbolSource::AddAssetPath(const StringPiece& path) { int32_t cookie = 0; return assets_.addAssetPath(android::String8(path.data(), path.size()), &cookie); |