summaryrefslogtreecommitdiff
path: root/tools/aapt2/process
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2017-04-21 16:57:59 -0700
committer Adam Lesinski <adamlesinski@google.com> 2017-04-21 17:02:09 -0700
commitb522f04bc2a581e2877bef4a44ac00b827f879ed (patch)
tree4cb0aa93571e8abfdc485ad6e3f2070ba5569347 /tools/aapt2/process
parent9431c476f35431f45a13c257b305e9999821190d (diff)
AAPT2: Allow truncating of package names
ResTable_package header only allows 127 UTF-16 characters, so AAPT would truncate the real package name to fit. AAPT2 would error-out on any package name longer than 127 UTF-16 characters. This strictness is not required except when building shared libraries, which use the full package name as a way of identifying the runtime assigned package ID to package name mapping. Bug: 36940145 Test: make aapt2_tests Change-Id: I7d2b7e50c7ab30c6a6c4f15d310e711f68e35091
Diffstat (limited to 'tools/aapt2/process')
-rw-r--r--tools/aapt2/process/IResourceTableConsumer.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/aapt2/process/IResourceTableConsumer.h b/tools/aapt2/process/IResourceTableConsumer.h
index 4526a79577d9..30dad8025900 100644
--- a/tools/aapt2/process/IResourceTableConsumer.h
+++ b/tools/aapt2/process/IResourceTableConsumer.h
@@ -32,9 +32,17 @@ namespace aapt {
class ResourceTable;
class SymbolTable;
+// The type of package to build.
+enum class PackageType {
+ kApp,
+ kSharedLib,
+ kStaticLib,
+};
+
struct IAaptContext {
virtual ~IAaptContext() = default;
+ virtual PackageType GetPackageType() = 0;
virtual SymbolTable* GetExternalSymbols() = 0;
virtual IDiagnostics* GetDiagnostics() = 0;
virtual const std::string& GetCompilationPackage() = 0;