summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-02-24 23:49:59 -0800
committerKenny Root <kroot@google.com>2010-02-24 23:49:59 -0800
commit7ff20e30c50cf1d47a7eaacd71665a1d2f4ecdc4 (patch)
treec9af0416cb8e87c61178b63b13d385bcb62af4c5
parent74f39d4c172398c96fa3d6dbdec740bc168e60f1 (diff)
downloadframeworks_base-7ff20e30c50cf1d47a7eaacd71665a1d2f4ecdc4.zip
frameworks_base-7ff20e30c50cf1d47a7eaacd71665a1d2f4ecdc4.tar.gz
frameworks_base-7ff20e30c50cf1d47a7eaacd71665a1d2f4ecdc4.tar.bz2
Create own reference for minSdkVersion in aapt
Fix bug where applications defining a minSdkVersion were experiencing transient errors from memory corruption in aapt. Change-Id: I839d5eda7388baac6133e735fa59f9799ca2822d
-rw-r--r--tools/aapt/Resource.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index f8c5c38..ae4bd14 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -224,9 +224,9 @@ static status_t parsePackage(Bundle* bundle, const sp<AaptAssets>& assets,
ssize_t minSdkIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE,
"minSdkVersion");
if (minSdkIndex >= 0) {
- String8 minSdkString = String8(
- block.getAttributeStringValue(minSdkIndex, &len));
- bundle->setMinSdkVersion(minSdkString.string());
+ const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len);
+ const char* minSdk8 = strdup(String8(minSdk16).string());
+ bundle->setMinSdkVersion(minSdk8);
}
}
}