diff options
| author | 2015-05-04 23:56:22 +0000 | |
|---|---|---|
| committer | 2015-05-04 23:56:24 +0000 | |
| commit | 247bc95cb31c6f7e56814818dc29aa1eb8512e6c (patch) | |
| tree | cbea46d1c765e4613a8f7ac951e6bce5a5649c00 /tools/aapt2/Linker.cpp | |
| parent | 2f519532eecd881b034a4e31f57336724604cb56 (diff) | |
| parent | 6ff19664f9279023c96e5a65c3059e1ef4beac0f (diff) | |
Merge "AAPT2: Record public status in a more robust way" into mnc-dev
Diffstat (limited to 'tools/aapt2/Linker.cpp')
| -rw-r--r-- | tools/aapt2/Linker.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tools/aapt2/Linker.cpp b/tools/aapt2/Linker.cpp index 42ea0f1e9b04..a8b7a14256b2 100644 --- a/tools/aapt2/Linker.cpp +++ b/tools/aapt2/Linker.cpp @@ -67,13 +67,21 @@ bool Linker::linkAndValidate() { usedIds[type->typeId].insert(entry->entryId); } - for (auto& valueConfig : entry->values) { - // Dispatch to the right method of this linker - // based on the value's type. - valueConfig.value->accept(*this, Args{ - ResourceNameRef{ mTable->getPackage(), type->type, entry->name }, - valueConfig.source - }); + if (entry->publicStatus.isPublic && entry->values.empty()) { + // A public resource has no values. It will not be encoded + // properly without a symbol table. This is a unresolved symbol. + addUnresolvedSymbol(ResourceNameRef{ + mTable->getPackage(), type->type, entry->name }, + entry->publicStatus.source); + } else { + for (auto& valueConfig : entry->values) { + // Dispatch to the right method of this linker + // based on the value's type. + valueConfig.value->accept(*this, Args{ + ResourceNameRef{ mTable->getPackage(), type->type, entry->name }, + valueConfig.source + }); + } } } } @@ -270,11 +278,6 @@ void Linker::visit(Styleable& styleable, ValueVisitorArgs& a) { } } -void Linker::visit(Sentinel& sentinel, ValueVisitorArgs& a) { - Args& args = static_cast<Args&>(a); - addUnresolvedSymbol(args.referrer, args.source); -} - void Linker::visit(Array& array, ValueVisitorArgs& a) { Args& args = static_cast<Args&>(a); |