Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef19d0ac authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "androidfw: Use the last package to create idmap."

parents 61fabe52 91a2b587
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -223,7 +223,8 @@ namespace {
    }

    status_t parse_data(IdmapBuffer& buf, const AssetManager& am) {
        const uint32_t packageId = am.getResources().getBasePackageId(0);
        const ResTable& rt = am.getResources();
        const uint32_t packageId = rt.getBasePackageId(rt.getBasePackageCount() - 1);

        uint16_t data16;
        status_t err = buf.nextUint16(&data16);
+4 −2
Original line number Diff line number Diff line
@@ -6019,8 +6019,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;