From 1ef0fa9d7242b1926543bc49e35905d1be02a781 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 15 Aug 2017 21:32:49 -0700 Subject: AAPT2: Fixup namespace implementation A few pieces were missing in the namespace mangling implementation. Namespace aware libraries now work, along with R class generation. Bug: 64706588 Test: make AaptTestNamespace_App Change-Id: I12f78d6aa909e782c0faf7ceaa36058f2e6c864a --- tools/aapt2/java/JavaClassGenerator.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/aapt2/java/JavaClassGenerator.cpp') diff --git a/tools/aapt2/java/JavaClassGenerator.cpp b/tools/aapt2/java/JavaClassGenerator.cpp index 44fa0f19a0e5..8da9106aa8d7 100644 --- a/tools/aapt2/java/JavaClassGenerator.cpp +++ b/tools/aapt2/java/JavaClassGenerator.cpp @@ -480,7 +480,7 @@ Maybe JavaClassGenerator::UnmangleResource(const StringPiece& packa if (NameMangler::Unmangle(&unmangled_name, &unmangled_package)) { // The entry name was mangled, and we successfully unmangled it. // Check that we want to emit this symbol. - if (package_name != unmangled_package) { + if (package_name_to_generate != unmangled_package) { // Skip the entry if it doesn't belong to the package we're writing. return {}; } @@ -579,8 +579,7 @@ bool JavaClassGenerator::Generate(const StringPiece& package_name_to_generate, continue; } - // Stay consistent with AAPT and generate an empty type class if the R class - // is public. + // Stay consistent with AAPT and generate an empty type class if the R class is public. const bool force_creation_if_empty = (options_.types == JavaClassGeneratorOptions::SymbolTypes::kPublic); -- cgit v1.2.3