summaryrefslogtreecommitdiff
path: root/tools/aapt2/format/binary/BinaryResourceParser.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2019-05-20 16:47:08 -0700
committerRyan Mitchell <rtmitchell@google.com>2019-06-06 14:19:26 +0000
commitc1676807f45a862256fb5b2804f15dbf4a90a11e (patch)
treed5377d9c595423001bdb097cac88488b1cb1ee1d /tools/aapt2/format/binary/BinaryResourceParser.cpp
parente05fdd2f7270296e7e965d8f3e8dc2badfb6ef95 (diff)
Retain parsed attribute type
If the value of an attribute enum is defined as a hexadecimal integer, flatten uses of the attribute as with the android::Res_value::TYPE_INT_HEX type. This change adds a "type" field to pb::Attribute::Symbol, which if left unset, will have a default value of android::Res_value::TYPE_INT_DEC when deserialized by aapt2. Bug: 124474141 Test: aapt2_tests and manual compilation of files and inspection using `aapt2 dump chunks` Change-Id: Ibf12394284fdbe3a8047f7ecf4fe68517dfc3abb
Diffstat (limited to 'tools/aapt2/format/binary/BinaryResourceParser.cpp')
-rw-r--r--tools/aapt2/format/binary/BinaryResourceParser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/aapt2/format/binary/BinaryResourceParser.cpp b/tools/aapt2/format/binary/BinaryResourceParser.cpp
index fd8e36ebf823..fcd6aaafba7a 100644
--- a/tools/aapt2/format/binary/BinaryResourceParser.cpp
+++ b/tools/aapt2/format/binary/BinaryResourceParser.cpp
@@ -614,6 +614,7 @@ std::unique_ptr<Attribute> BinaryResourceParser::ParseAttr(const ResourceNameRef
if (attr->type_mask & (ResTable_map::TYPE_ENUM | ResTable_map::TYPE_FLAGS)) {
Attribute::Symbol symbol;
symbol.value = util::DeviceToHost32(map_entry.value.data);
+ symbol.type = map_entry.value.dataType;
symbol.symbol = Reference(util::DeviceToHost32(map_entry.name.ident));
attr->symbols.push_back(std::move(symbol));
}