summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceUtils.cpp
diff options
context:
space:
mode:
authorShane Farmer <safarmer@google.com>2018-02-14 15:40:35 -0800
committerShane Farmer <safarmer@google.com>2018-02-14 15:44:42 -0800
commitd05b9130fdbff8062084b566a380c5b058273d75 (patch)
treec841be557f76cf8be9ce9152860d4a47ff15f0bb /tools/aapt2/ResourceUtils.cpp
parent11cdc1cf7ab2e915611e2bb7264bd312012a9b64 (diff)
AAPT2: Fix compatible-screens element in AndroidManifest.xml
Fix an issue where the compatible-screens element was not being populated correctly. The previous version was missing the screenSize attribute which is mandatory. The attributes were also missing the resource ID from the framework library as these are a part of the public API. Change-Id: I2f594c2259831dbbd96c58db4ba55e8288d4231e Test: unit tests Test: manually split an APK and dumped with aapt
Diffstat (limited to 'tools/aapt2/ResourceUtils.cpp')
-rw-r--r--tools/aapt2/ResourceUtils.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp
index 02ac86c94b46..628466d0a281 100644
--- a/tools/aapt2/ResourceUtils.cpp
+++ b/tools/aapt2/ResourceUtils.cpp
@@ -520,6 +520,10 @@ std::unique_ptr<BinaryPrimitive> TryParseInt(const StringPiece& str) {
return util::make_unique<BinaryPrimitive>(value);
}
+std::unique_ptr<BinaryPrimitive> MakeInt(uint32_t val) {
+ return util::make_unique<BinaryPrimitive>(android::Res_value::TYPE_INT_DEC, val);
+}
+
std::unique_ptr<BinaryPrimitive> TryParseFloat(const StringPiece& str) {
std::u16string str16 = util::Utf8ToUtf16(util::TrimWhitespace(str));
android::Res_value value;