From dfa5e0705ff82f15e228ba076bc192893bcbe118 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 12 May 2015 21:42:59 -0700 Subject: 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 --- tools/aapt2/BinaryResourceParser.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools/aapt2/BinaryResourceParser.cpp') 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 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(nullType); } -- cgit v1.1