From 54de298c01ad79fe7f5850eb7aefc2542dd8d5da Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 16 Dec 2014 09:16:26 -0800 Subject: AAPT: Copy android:revisionCode to Splits Bug:18706179 Change-Id: I669b56e0b67dd1bfda7749ef433b55af16851154 --- tools/aapt/Resource.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools/aapt/Resource.cpp') diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index e3a020085551..e2e83e493e7d 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -257,6 +257,11 @@ static status_t parsePackage(Bundle* bundle, const sp& assets, assets->setPackage(String8(block.getAttributeStringValue(nameIndex, &len))); + ssize_t revisionCodeIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE, "revisionCode"); + if (revisionCodeIndex >= 0) { + bundle->setRevisionCode(String8(block.getAttributeStringValue(revisionCodeIndex, &len)).string()); + } + String16 uses_sdk16("uses-sdk"); while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) { @@ -1075,6 +1080,14 @@ status_t generateAndroidManifestForSplit(Bundle* bundle, const sp& a return UNKNOWN_ERROR; } + // Add the 'revisionCode' attribute, which is set to the original revisionCode. + if (bundle->getRevisionCode().size() > 0) { + if (!addTagAttribute(manifest, RESOURCES_ANDROID_NAMESPACE, "revisionCode", + bundle->getRevisionCode().string(), true, true)) { + return UNKNOWN_ERROR; + } + } + // Add the 'split' attribute which describes the configurations included. String8 splitName("config."); splitName.append(split->getPackageSafeName()); -- cgit v1.2.3-59-g8ed1b