diff options
Diffstat (limited to 'tools/aapt2/format/binary/TableFlattener.cpp')
-rw-r--r-- | tools/aapt2/format/binary/TableFlattener.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/aapt2/format/binary/TableFlattener.cpp b/tools/aapt2/format/binary/TableFlattener.cpp index 8641a7c93d19..6c1a9ba2cbad 100644 --- a/tools/aapt2/format/binary/TableFlattener.cpp +++ b/tools/aapt2/format/binary/TableFlattener.cpp @@ -446,7 +446,7 @@ class PackageFlattener { config_masks[entry->id.value()] |= util::HostToDevice32(ResTable_typeSpec::SPEC_PUBLIC); } - if (entry->overlayable) { + if (!entry->overlayable_declarations.empty()) { config_masks[entry->id.value()] |= util::HostToDevice32(ResTable_typeSpec::SPEC_OVERLAYABLE); } @@ -573,15 +573,17 @@ class PackageFlattener { } // namespace bool TableFlattener::Consume(IAaptContext* context, ResourceTable* table) { - // We must do this before writing the resources, since the string pool IDs may change. - table->string_pool.Prune(); - table->string_pool.Sort([](const StringPool::Context& a, const StringPool::Context& b) -> int { - int diff = util::compare(a.priority, b.priority); - if (diff == 0) { - diff = a.config.compare(b.config); - } - return diff; - }); + if (options_.sort_stringpool_entries) { + // We must do this before writing the resources, since the string pool IDs may change. + table->string_pool.Prune(); + table->string_pool.Sort([](const StringPool::Context &a, const StringPool::Context &b) -> int { + int diff = util::compare(a.priority, b.priority); + if (diff == 0) { + diff = a.config.compare(b.config); + } + return diff; + }); + } // Write the ResTable header. ChunkWriter table_writer(buffer_); |