diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-12-16 18:02:09 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-16 18:02:09 +0000 |
commit | 915f44e1ee98f8c1d1b9ac0ac45ee05d656734a6 (patch) | |
tree | 3caa7f670f3927b6f7386aba249f3bfba1f606ca /tools/aapt | |
parent | 8a23b3820d6f4d08b6b6ca3ffb0f85bd829f5e97 (diff) | |
parent | 503a4494d64d30f9b904b24a56fff986810da610 (diff) | |
download | frameworks_base-915f44e1ee98f8c1d1b9ac0ac45ee05d656734a6.zip frameworks_base-915f44e1ee98f8c1d1b9ac0ac45ee05d656734a6.tar.gz frameworks_base-915f44e1ee98f8c1d1b9ac0ac45ee05d656734a6.tar.bz2 |
am 503a4494: am f1f179a7: Merge "AAPT: Copy android:revisionCode to Splits" into lmp-mr1-dev
* commit '503a4494d64d30f9b904b24a56fff986810da610':
AAPT: Copy android:revisionCode to Splits
Diffstat (limited to 'tools/aapt')
-rw-r--r-- | tools/aapt/Bundle.h | 3 | ||||
-rw-r--r-- | tools/aapt/Resource.cpp | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h index 0e130f4..e7cde74 100644 --- a/tools/aapt/Bundle.h +++ b/tools/aapt/Bundle.h @@ -179,6 +179,8 @@ public: void setVersionName(const char* val) { mVersionName = val; } bool getReplaceVersion() { return mReplaceVersion; } void setReplaceVersion(bool val) { mReplaceVersion = val; } + const android::String8& getRevisionCode() { return mRevisionCode; } + void setRevisionCode(const char* val) { mRevisionCode = android::String8(val); } const char* getCustomPackage() const { return mCustomPackage; } void setCustomPackage(const char* val) { mCustomPackage = val; } const char* getExtraPackages() const { return mExtraPackages; } @@ -297,6 +299,7 @@ private: android::String8 mFeatureOfPackage; android::String8 mFeatureAfterPackage; + android::String8 mRevisionCode; const char* mManifestMinSdkVersion; const char* mMinSdkVersion; const char* mTargetSdkVersion; diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 96d5c98..36299c2 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -266,6 +266,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) { @@ -1103,6 +1108,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()); |