From dfc3f6aaeefceda4ff0337fa0e51eab83c0c820e Mon Sep 17 00:00:00 2001 From: yingying Date: Mon, 27 Oct 2014 19:13:53 +0800 Subject: 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 --- libs/androidfw/ResourceTypes.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/androidfw') 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 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; -- cgit v1.1