From 71be70507de9cb619b644e55eda1cc181e3f7e90 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 12 Dec 2017 16:48:07 -0800 Subject: AAPT2: Propagate SPEC_OVERLAYABLE flag to final APK Resources can be marked as overlayable, which means they can be overlaid by runtime resource overlays. This change propagates this state to the final resource table that is installed on device. Future work: - Have the idmap tool respect the overlayable state and ignore entries that overlay anything else. Bug: 64980941 Test: make aapt2_tests Change-Id: Id45b1e141a281be2ee32a4ac3096fcf1114d523b --- tools/aapt2/Debug.cpp | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'tools/aapt2/Debug.cpp') diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp index 0f6fb50aba48..5831875680ac 100644 --- a/tools/aapt2/Debug.cpp +++ b/tools/aapt2/Debug.cpp @@ -294,36 +294,42 @@ void Debug::PrintTable(const ResourceTable& table, const DebugPrintTableOptions& printer->Print("/"); printer->Print(entry->name); - switch (entry->symbol_status.state) { - case SymbolState::kPublic: + switch (entry->visibility.level) { + case Visibility::Level::kPublic: printer->Print(" PUBLIC"); break; - case SymbolState::kPrivate: + case Visibility::Level::kPrivate: printer->Print(" _PRIVATE_"); break; - case SymbolState::kUndefined: + case Visibility::Level::kUndefined: // Print nothing. break; } + if (entry->overlayable) { + printer->Print(" OVERLAYABLE"); + } + printer->Println(); - printer->Indent(); - for (const auto& value : entry->values) { - printer->Print("("); - printer->Print(value->config.to_string()); - printer->Print(") "); - value->value->Accept(&headline_printer); - if (options.show_sources && !value->value->GetSource().path.empty()) { - printer->Print(" src="); - printer->Print(value->value->GetSource().to_string()); - } - printer->Println(); + if (options.show_values) { printer->Indent(); - value->value->Accept(&body_printer); + for (const auto& value : entry->values) { + printer->Print("("); + printer->Print(value->config.to_string()); + printer->Print(") "); + value->value->Accept(&headline_printer); + if (options.show_sources && !value->value->GetSource().path.empty()) { + printer->Print(" src="); + printer->Print(value->value->GetSource().to_string()); + } + printer->Println(); + printer->Indent(); + value->value->Accept(&body_printer); + printer->Undent(); + } printer->Undent(); } - printer->Undent(); } printer->Undent(); } -- cgit v1.2.3-59-g8ed1b