summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceTable.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2017-02-16 12:05:42 -0800
committer Adam Lesinski <adamlesinski@google.com> 2017-02-22 11:16:13 -0800
commitceb9b2f80f853059233cdd29057f39a5960a74ae (patch)
tree9093e8537319a97d8a2cbd8d4f0042c81de5ff8e /tools/aapt2/ResourceTable.cpp
parentf9bd2944694539f1dce74d420156cc50bbb4af14 (diff)
AAPT2: Shared library support
Test: make aapt2_tests Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
Diffstat (limited to 'tools/aapt2/ResourceTable.cpp')
-rw-r--r--tools/aapt2/ResourceTable.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/tools/aapt2/ResourceTable.cpp b/tools/aapt2/ResourceTable.cpp
index dd78750db290..6e4b450b65e5 100644
--- a/tools/aapt2/ResourceTable.cpp
+++ b/tools/aapt2/ResourceTable.cpp
@@ -387,8 +387,7 @@ bool ResourceTable::AddResourceImpl(
}
ResourceTablePackage* package = FindOrCreatePackage(name.package);
- if (res_id.is_valid() && package->id &&
- package->id.value() != res_id.package_id()) {
+ if (res_id.is_valid_dynamic() && package->id && package->id.value() != res_id.package_id()) {
diag->Error(DiagMessage(value->GetSource())
<< "trying to add resource '" << name << "' with ID " << res_id
<< " but package '" << package->name << "' already has ID "
@@ -397,7 +396,7 @@ bool ResourceTable::AddResourceImpl(
}
ResourceTableType* type = package->FindOrCreateType(name.type);
- if (res_id.is_valid() && type->id && type->id.value() != res_id.type_id()) {
+ if (res_id.is_valid_dynamic() && type->id && type->id.value() != res_id.type_id()) {
diag->Error(DiagMessage(value->GetSource())
<< "trying to add resource '" << name << "' with ID " << res_id
<< " but type '" << type->type << "' already has ID "
@@ -406,8 +405,7 @@ bool ResourceTable::AddResourceImpl(
}
ResourceEntry* entry = type->FindOrCreateEntry(name.entry);
- if (res_id.is_valid() && entry->id &&
- entry->id.value() != res_id.entry_id()) {
+ if (res_id.is_valid_dynamic() && entry->id && entry->id.value() != res_id.entry_id()) {
diag->Error(DiagMessage(value->GetSource())
<< "trying to add resource '" << name << "' with ID " << res_id
<< " but resource already has ID "
@@ -441,7 +439,7 @@ bool ResourceTable::AddResourceImpl(
}
}
- if (res_id.is_valid()) {
+ if (res_id.is_valid_dynamic()) {
package->id = res_id.package_id();
type->id = res_id.type_id();
entry->id = res_id.entry_id();
@@ -480,8 +478,7 @@ bool ResourceTable::SetSymbolStateImpl(const ResourceNameRef& name,
}
ResourceTablePackage* package = FindOrCreatePackage(name.package);
- if (res_id.is_valid() && package->id &&
- package->id.value() != res_id.package_id()) {
+ if (res_id.is_valid_dynamic() && package->id && package->id.value() != res_id.package_id()) {
diag->Error(DiagMessage(symbol.source)
<< "trying to add resource '" << name << "' with ID " << res_id
<< " but package '" << package->name << "' already has ID "
@@ -490,7 +487,7 @@ bool ResourceTable::SetSymbolStateImpl(const ResourceNameRef& name,
}
ResourceTableType* type = package->FindOrCreateType(name.type);
- if (res_id.is_valid() && type->id && type->id.value() != res_id.type_id()) {
+ if (res_id.is_valid_dynamic() && type->id && type->id.value() != res_id.type_id()) {
diag->Error(DiagMessage(symbol.source)
<< "trying to add resource '" << name << "' with ID " << res_id
<< " but type '" << type->type << "' already has ID "
@@ -499,8 +496,7 @@ bool ResourceTable::SetSymbolStateImpl(const ResourceNameRef& name,
}
ResourceEntry* entry = type->FindOrCreateEntry(name.entry);
- if (res_id.is_valid() && entry->id &&
- entry->id.value() != res_id.entry_id()) {
+ if (res_id.is_valid_dynamic() && entry->id && entry->id.value() != res_id.entry_id()) {
diag->Error(DiagMessage(symbol.source)
<< "trying to add resource '" << name << "' with ID " << res_id
<< " but resource already has ID "
@@ -509,7 +505,7 @@ bool ResourceTable::SetSymbolStateImpl(const ResourceNameRef& name,
return false;
}
- if (res_id.is_valid()) {
+ if (res_id.is_valid_dynamic()) {
package->id = res_id.package_id();
type->id = res_id.type_id();
entry->id = res_id.entry_id();