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/java/JavaClassGenerator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/aapt2/java/JavaClassGenerator.cpp') diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp index 8c8c2549609a..6b07b1e96261 100644 --- a/tools/aapt2/java/JavaClassGenerator.cpp +++ b/tools/aapt2/java/JavaClassGenerator.cpp @@ -191,14 +191,14 @@ JavaClassGenerator::JavaClassGenerator(IAaptContext* context, const JavaClassGeneratorOptions& options) : context_(context), table_(table), options_(options) {} -bool JavaClassGenerator::SkipSymbol(SymbolState state) { +bool JavaClassGenerator::SkipSymbol(Visibility::Level level) { switch (options_.types) { case JavaClassGeneratorOptions::SymbolTypes::kAll: return false; case JavaClassGeneratorOptions::SymbolTypes::kPublicPrivate: - return state == SymbolState::kUndefined; + return level == Visibility::Level::kUndefined; case JavaClassGeneratorOptions::SymbolTypes::kPublic: - return state != SymbolState::kPublic; + return level != Visibility::Level::kPublic; } return true; } @@ -444,8 +444,8 @@ void JavaClassGenerator::ProcessResource(const ResourceNameRef& name, const Reso AnnotationProcessor* processor = resource_member->GetCommentBuilder(); // Add the comments from any tags. - if (entry.symbol_status.state != SymbolState::kUndefined) { - processor->AppendComment(entry.symbol_status.comment); + if (entry.visibility.level != Visibility::Level::kUndefined) { + processor->AppendComment(entry.visibility.comment); } // Add the comments from all configurations of this entry. @@ -484,7 +484,7 @@ void JavaClassGenerator::ProcessResource(const ResourceNameRef& name, const Reso Maybe JavaClassGenerator::UnmangleResource(const StringPiece& package_name, const StringPiece& package_name_to_generate, const ResourceEntry& entry) { - if (SkipSymbol(entry.symbol_status.state)) { + if (SkipSymbol(entry.visibility.level)) { return {}; } -- cgit v1.2.3