summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authoryingying <yingying@codeaurora.org>2014-10-27 19:13:53 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-20 17:07:39 -0700
commitdfc3f6aaeefceda4ff0337fa0e51eab83c0c820e (patch)
tree1ba4a38280cb332d47d06195c1c39a8a576bea03 /libs
parentcaaba96fcb34849406e362759931ffa4340a89c5 (diff)
downloadframeworks_base-dfc3f6aaeefceda4ff0337fa0e51eab83c0c820e.zip
frameworks_base-dfc3f6aaeefceda4ff0337fa0e51eab83c0c820e.tar.gz
frameworks_base-dfc3f6aaeefceda4ff0337fa0e51eab83c0c820e.tar.bz2
androidfw: Use the last package to create idmap.
Overlaid packages contain one or two package groups, the first one is system package(android), and the second one is application package. So it should use the last package group to create idmap. When inspecting the idmap, similar as above. Change-Id: I97e0179bc5b5acdcacbe6ec5b5b7c22af51d1d0b
Diffstat (limited to 'libs')
-rw-r--r--libs/androidfw/ResourceTypes.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 62aabb1..585f4a2 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6379,8 +6379,10 @@ status_t ResTable::createIdmap(const ResTable& overlay,
KeyedVector<uint8_t, IdmapTypeMap> map;
- // overlaid packages are assumed to contain only one package group
- const PackageGroup* pg = mPackageGroups[0];
+ // Overlaid packages are assumed to contain only one package group or two package group
+ // as one is "system package(android)", and another is "application package". So we need
+ // to use the last package group to create idmap.
+ const PackageGroup* pg = mPackageGroups[mPackageGroups.size() - 1];
// starting size is header
*outSize = ResTable::IDMAP_HEADER_SIZE_BYTES;