From fab50875b98e8274ac8ee44b38ba42521bbbf1f9 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Wed, 16 Apr 2014 14:40:42 -0700 Subject: Add support for building split APKs Build multiple APKs, each containing a disjoint subset of configurations. These can then be loaded into the device AssetManager and should operate as if they were never split. Use the idea of building multiple sets of files, where each set represents an APK. An ApkBuilder can place files in a set based on its configuration, but you can actually add directly to a set, in the case of the resources.arsc and generated AndroidManifest.xml for splits. Change-Id: Ic65d3f0ac1bbd290185695b9971d425c85ab1de3 --- tools/aapt/ResourceTable.h | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'tools/aapt/ResourceTable.h') diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h index ec8fd175e161..a73993c9022f 100644 --- a/tools/aapt/ResourceTable.h +++ b/tools/aapt/ResourceTable.h @@ -7,8 +7,10 @@ #ifndef RESOURCE_TABLE_H #define RESOURCE_TABLE_H +#include "ConfigDescription.h" #include "StringPool.h" #include "SourcePos.h" +#include "ResourceFilter.h" #include #include @@ -76,37 +78,6 @@ public: class Type; class Entry; - struct ConfigDescription : public ResTable_config { - ConfigDescription() { - memset(this, 0, sizeof(*this)); - size = sizeof(ResTable_config); - } - ConfigDescription(const ResTable_config&o) { - *static_cast(this) = o; - size = sizeof(ResTable_config); - } - ConfigDescription(const ConfigDescription&o) { - *static_cast(this) = o; - } - - ConfigDescription& operator=(const ResTable_config& o) { - *static_cast(this) = o; - size = sizeof(ResTable_config); - return *this; - } - ConfigDescription& operator=(const ConfigDescription& o) { - *static_cast(this) = o; - return *this; - } - - inline bool operator<(const ConfigDescription& o) const { return compare(o) < 0; } - inline bool operator<=(const ConfigDescription& o) const { return compare(o) <= 0; } - inline bool operator==(const ConfigDescription& o) const { return compare(o) == 0; } - inline bool operator!=(const ConfigDescription& o) const { return compare(o) != 0; } - inline bool operator>=(const ConfigDescription& o) const { return compare(o) >= 0; } - inline bool operator>(const ConfigDescription& o) const { return compare(o) > 0; } - }; - ResourceTable(Bundle* bundle, const String16& assetsPackage); status_t addIncludedResources(Bundle* bundle, const sp& assets); @@ -182,7 +153,7 @@ public: size_t numLocalResources() const; bool hasResources() const; - sp flatten(Bundle*); + sp flatten(Bundle* bundle, const sp& filter); static inline uint32_t makeResId(uint32_t packageId, uint32_t typeId, @@ -223,7 +194,7 @@ public: void addLocalization(const String16& name, const String8& locale, const SourcePos& src); status_t validateLocalizations(void); - status_t flatten(Bundle*, const sp& dest); + status_t flatten(Bundle* bundle, const sp& filter, const sp& dest); status_t flattenLibraryTable(const sp& dest, const Vector >& libs); void writePublicDefinitions(const String16& package, FILE* fp); -- cgit v1.2.3-59-g8ed1b