if (minSdkIndex >= 0) {
const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len);
const char* minSdk8 = strdup(String8(minSdk16).string());
- bundle->setMinSdkVersion(minSdk8);
+ bundle->setManifestMinSdkVersion(minSdk8);
}
}
}
// Standard flags for compiled XML and optional UTF-8 encoding
int xmlFlags = XML_COMPILE_STANDARD_RESOURCE;
- if (bundle->getUTF8()) {
+
+ /* Only enable UTF-8 if the caller of aapt didn't specifically
+ * request UTF-16 encoding and the parameters of this package
+ * allow UTF-8 to be used.
+ */
+ if (!bundle->getWantUTF16()
+ && bundle->isUTF8Available()) {
xmlFlags |= XML_COMPILE_UTF8;
}