summaryrefslogtreecommitdiffstats
path: root/tools/aapt2/BinaryResourceParser.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-05-12 21:42:59 -0700
committerAdam Lesinski <adamlesinski@google.com>2015-05-12 21:56:43 -0700
commitdfa5e0705ff82f15e228ba076bc192893bcbe118 (patch)
tree10dbca8e4feeefc96019fcab8fa08c7943b8c97e /tools/aapt2/BinaryResourceParser.cpp
parentd13fb249865703901b77f48c5fed1864f06e1c63 (diff)
downloadframeworks_base-dfa5e0705ff82f15e228ba076bc192893bcbe118.zip
frameworks_base-dfa5e0705ff82f15e228ba076bc192893bcbe118.tar.gz
frameworks_base-dfa5e0705ff82f15e228ba076bc192893bcbe118.tar.bz2
AAPT2: Fix issue where @null was wrongly encoded
@null must be encoded as TYPE_REFERENCE with a value of 0. TYPE_NULL is used by the runtime as a placeholder when resolving style attributes. If we set a style attribute to TYPE_NULL, the runtime will throw. The runtime will convert a TYPE_REFERENCE with value 0 to a proper null value. Change-Id: Id983ca7e1fbee3124dddafe32f1b5741b824225b
Diffstat (limited to 'tools/aapt2/BinaryResourceParser.cpp')
-rw-r--r--tools/aapt2/BinaryResourceParser.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/aapt2/BinaryResourceParser.cpp b/tools/aapt2/BinaryResourceParser.cpp
index 620f0fe..3559f43 100644
--- a/tools/aapt2/BinaryResourceParser.cpp
+++ b/tools/aapt2/BinaryResourceParser.cpp
@@ -697,8 +697,7 @@ std::unique_ptr<Item> BinaryResourceParser::parseValue(const ResourceNameRef& na
// This is not an unresolved symbol, so it must be the magic @null reference.
Res_value nullType = {};
- nullType.dataType = Res_value::TYPE_NULL;
- nullType.data = Res_value::DATA_NULL_UNDEFINED;
+ nullType.dataType = Res_value::TYPE_REFERENCE;
return util::make_unique<BinaryPrimitive>(nullType);
}