summaryrefslogtreecommitdiffstats
path: root/libs/androidfw
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-09-30 16:06:58 -0700
committerAdam Lesinski <adamlesinski@google.com>2014-09-30 16:18:09 -0700
commit5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6 (patch)
treef0ddd3b922e53ed84c14558c6345724a588656ba /libs/androidfw
parent75c33d9d04d8c0a9884a70077681261b57c7833c (diff)
downloadframeworks_base-5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.zip
frameworks_base-5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.tar.gz
frameworks_base-5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.tar.bz2
Fix issue with using locally defined attrs in a shared lib
The attribute name resource IDs were never fixed up with the runtime package ID so we weren't finding attributes whenever the runtime package ID was different than the build time one, which happened to be when a shared lib referenced itself (0x00 vs 0x02). Bug:17666947 Change-Id: Icf3e874bcea0e27eebe42d60fbed626a34bf9266
Diffstat (limited to 'libs/androidfw')
-rw-r--r--libs/androidfw/ResourceTypes.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 8cef137..61a767c 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -1185,7 +1185,11 @@ uint32_t ResXMLParser::getAttributeNameResID(size_t idx) const
{
int32_t id = getAttributeNameID(idx);
if (id >= 0 && (size_t)id < mTree.mNumResIds) {
- return dtohl(mTree.mResIds[id]);
+ uint32_t resId = dtohl(mTree.mResIds[id]);
+ if (mTree.mDynamicRefTable == NULL ||
+ mTree.mDynamicRefTable->lookupResourceId(&resId) == NO_ERROR) {
+ return resId;
+ }
}
return 0;
}