summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-10-28 15:44:27 -0700
committerAdam Lesinski <adamlesinski@google.com>2015-11-24 15:38:40 -0800
commit9d0f7d44d5cc5322415f52f7ce03cc37a478b350 (patch)
tree1882cbfd2f9867e865444c95da0d79028d79ae60 /tools/aapt/ResourceTable.h
parent1cffc196610891f6669c33404f3ff5b0232b7059 (diff)
Implement AAPT Bundle format
AAPT will scan XML files looking for the <aapt:attr> XML tag. <!-- @layout/bundle.xml --> <ImageView xmlns:aapt="http://schemas.android.com/aapt"> <aapt:attr name="android:src"> <vector android:pathData="..." ...> </vector> </aapt:attr> </ImageView> The SINGLE child element of the <aapt:attr> tag is extracted into its own top level resource. It is given a generated name. The parent element of <aapt:attr> is then given the resource attribute that was assigned to the `name' attribute. The value is set to a reference to the generated resource. <!-- @layout/bundle.xml --> <ImageView android:src="@drawable/bundle_1.xml"> </ImageView> <!-- @layout/bundle_1.xml --> <vector android:pathData="..." ...> </vector> Bug:22627686 Change-Id: I31bc96aae30d38bfd0b16508d0f585de5fd88a07
Diffstat (limited to 'tools/aapt/ResourceTable.h')
-rw-r--r--tools/aapt/ResourceTable.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h
index c4bdf09d8b19..8ef84f773f18 100644
--- a/tools/aapt/ResourceTable.h
+++ b/tools/aapt/ResourceTable.h
@@ -83,6 +83,7 @@ struct CompileResourceWorkItem {
String16 resourceName;
String8 resPath;
sp<AaptFile> file;
+ sp<XMLNode> xmlRoot;
};
class ResourceTable : public ResTable::Accessor
@@ -206,6 +207,12 @@ public:
const sp<AaptFile>& file,
const sp<XMLNode>& root);
+ status_t processBundleFormat(const Bundle* bundle,
+ const String16& resourceName,
+ const sp<AaptFile>& file,
+ const sp<XMLNode>& parent);
+
+
sp<AaptFile> flatten(Bundle* bundle, const sp<const ResourceFilter>& filter,
const bool isBase);
@@ -586,6 +593,11 @@ private:
Res_value* outValue);
int getPublicAttributeSdkLevel(uint32_t attrId) const;
+ status_t processBundleFormatImpl(const Bundle* bundle,
+ const String16& resourceName,
+ const sp<AaptFile>& file,
+ const sp<XMLNode>& parent,
+ Vector<sp<XMLNode> >* namespaces);
String16 mAssetsPackage;
PackageType mPackageType;