summaryrefslogtreecommitdiff
path: root/libs/androidfw/AttributeResolution.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2019-02-11 10:57:59 -0800
committerSteven Moreland <smoreland@google.com>2019-02-11 11:00:44 -0800
commit567b4cf7b54062947b5eabe6ecef7b70fbb7301b (patch)
treee7ffe81f03f43359763c39a8c5cf307ba7e96ba7 /libs/androidfw/AttributeResolution.cpp
parent4f7ea9f121ef0b81ab9688636cb8ef570f15559c (diff)
parent0932a16cdf085a16b2b6bf46d457745e317eb4ad (diff)
Merge QP1A.190205.002
Change-Id: I8e29d3d840642579119f10af2f90dd536304070f
Diffstat (limited to 'libs/androidfw/AttributeResolution.cpp')
-rw-r--r--libs/androidfw/AttributeResolution.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/androidfw/AttributeResolution.cpp b/libs/androidfw/AttributeResolution.cpp
index 18d74efdbacf..cc177af7be6f 100644
--- a/libs/androidfw/AttributeResolution.cpp
+++ b/libs/androidfw/AttributeResolution.cpp
@@ -286,7 +286,7 @@ void ApplyStyle(Theme* theme, ResXMLParser* xml_parser, uint32_t def_style_attr,
value.dataType = Res_value::TYPE_NULL;
value.data = Res_value::DATA_NULL_UNDEFINED;
config.density = 0;
- uint32_t source_style_resid = 0;
+ uint32_t value_source_resid = 0;
// Try to find a value for this attribute... we prioritize values
// coming from, first XML attributes, then XML style, then default
@@ -300,6 +300,7 @@ void ApplyStyle(Theme* theme, ResXMLParser* xml_parser, uint32_t def_style_attr,
if (kDebugStyles) {
ALOGI("-> From XML: type=0x%x, data=0x%08x", value.dataType, value.data);
}
+ value_source_resid = xml_parser->getSourceResourceId();
}
if (value.dataType == Res_value::TYPE_NULL && value.data != Res_value::DATA_NULL_EMPTY) {
@@ -310,7 +311,7 @@ void ApplyStyle(Theme* theme, ResXMLParser* xml_parser, uint32_t def_style_attr,
cookie = entry->cookie;
type_set_flags = style_flags;
value = entry->value;
- source_style_resid = entry->style;
+ value_source_resid = entry->style;
if (kDebugStyles) {
ALOGI("-> From style: type=0x%x, data=0x%08x, style=0x%08x", value.dataType, value.data,
entry->style);
@@ -330,7 +331,7 @@ void ApplyStyle(Theme* theme, ResXMLParser* xml_parser, uint32_t def_style_attr,
ALOGI("-> From def style: type=0x%x, data=0x%08x, style=0x%08x", value.dataType, value.data,
entry->style);
}
- source_style_resid = entry->style;
+ value_source_resid = entry->style;
}
}
@@ -349,6 +350,7 @@ void ApplyStyle(Theme* theme, ResXMLParser* xml_parser, uint32_t def_style_attr,
} else if (value.data != Res_value::DATA_NULL_EMPTY) {
// If we still don't have a value for this attribute, try to find it in the theme!
ApkAssetsCookie new_cookie = theme->GetAttribute(cur_ident, &value, &type_set_flags);
+ // TODO: set value_source_resid for the style in the theme that was used.
if (new_cookie != kInvalidCookie) {
if (kDebugStyles) {
ALOGI("-> From theme: type=0x%x, data=0x%08x", value.dataType, value.data);
@@ -386,7 +388,7 @@ void ApplyStyle(Theme* theme, ResXMLParser* xml_parser, uint32_t def_style_attr,
out_values[STYLE_RESOURCE_ID] = resid;
out_values[STYLE_CHANGING_CONFIGURATIONS] = type_set_flags;
out_values[STYLE_DENSITY] = config.density;
- out_values[SYTLE_SOURCE_STYLE] = source_style_resid;
+ out_values[SYTLE_SOURCE_RESOURCE_ID] = value_source_resid;
if (value.dataType != Res_value::TYPE_NULL || value.data == Res_value::DATA_NULL_EMPTY) {
indices_idx++;