summaryrefslogtreecommitdiff
path: root/tools/aapt/Resource.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-12-16 17:57:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-16 17:57:07 +0000
commit503a4494d64d30f9b904b24a56fff986810da610 (patch)
treed891fdef4bde1b4a648f8f8fad03a86095240a4a /tools/aapt/Resource.cpp
parent84c7ef8a28d321e190d4d3f9a0c91ee5ae41bf9a (diff)
parentf1f179a765b6969ba51574d4a10b0381acb0f945 (diff)
am f1f179a7: Merge "AAPT: Copy android:revisionCode to Splits" into lmp-mr1-dev
* commit 'f1f179a765b6969ba51574d4a10b0381acb0f945': AAPT: Copy android:revisionCode to Splits
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r--tools/aapt/Resource.cpp13
1 files changed, 13 insertions, 0 deletions
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<AaptAssets>& 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<AaptAssets>& 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());