diff options
author | Chris Gross <chrisgross@google.com> | 2021-05-19 11:39:13 -0700 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-05-21 00:34:23 +0000 |
commit | 219787565ff982848d596fa8743cd132af113e6b (patch) | |
tree | 93bd3c94771fb966fdf611d38865e712fb83e969 /tools/aapt2/compile/IdAssigner.cpp | |
parent | 7b4a006d559a571313e36799d93af7e3c6b69c82 (diff) | |
parent | 75eb1dd292d1800d660c5146464264b25854d318 (diff) |
Merge SP1A.210513.004
Change-Id: Ic23aece12c3bbd2b4dcf3205fdbcdd1601deabec
Diffstat (limited to 'tools/aapt2/compile/IdAssigner.cpp')
-rw-r--r-- | tools/aapt2/compile/IdAssigner.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/aapt2/compile/IdAssigner.cpp b/tools/aapt2/compile/IdAssigner.cpp index 9a50b263c006..339b8af5d536 100644 --- a/tools/aapt2/compile/IdAssigner.cpp +++ b/tools/aapt2/compile/IdAssigner.cpp @@ -129,11 +129,16 @@ bool IdAssigner::Consume(IAaptContext* context, ResourceTable* table) { for (auto& type : package->types) { for (auto& entry : type->entries) { const ResourceName name(package->name, type->type, entry->name); - if (entry->id) { - if (!assigned_ids.ReserveId(name, entry->id.value(), entry->visibility, - context->GetDiagnostics())) { - return false; - } + if (entry->id && !assigned_ids.ReserveId(name, entry->id.value(), entry->visibility, + context->GetDiagnostics())) { + return false; + } + + auto v = entry->visibility; + v.staged_api = true; + if (entry->staged_id && !assigned_ids.ReserveId(name, entry->staged_id.value().id, v, + context->GetDiagnostics())) { + return false; } if (assigned_id_map_) { @@ -237,7 +242,7 @@ Result<std::monostate> TypeGroup::ReserveId(const ResourceName& name, ResourceId if (type_id_ != id.type_id()) { // Currently there cannot be multiple type ids for a single type. std::stringstream error; - error << "type '" << name.type << "' already has ID " << std::hex << (int)id.type_id(); + error << "type '" << name.type << "' already has ID " << std::hex << (int)type_id_; return unexpected(error.str()); } |