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
diff --git a/tools/aapt2/Resources.proto b/tools/aapt2/Resources.proto
index b2fc084..65f4652 100644
--- a/tools/aapt2/Resources.proto
+++ b/tools/aapt2/Resources.proto
@@ -388,6 +388,9 @@
// The value of the enum/flag.
uint32 value = 4;
+
+ // The data type of the enum/flag as defined in android::Res_value.
+ uint32 type = 5;
}
// Bitmask of formats allowed for an attribute.