diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-12-02 23:07:43 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-02 23:07:43 +0000 |
commit | 9438ad1599716176fb6c593e77a2e93b265bbcb5 (patch) | |
tree | b8d7eef8c9baf5837a896a0e2ccbdd7f1d930a29 /libs/androidfw | |
parent | 723bce8a0d4fa900ca4344c03e5e82b5881fcf19 (diff) | |
parent | e580d6617f67a1db5eff7ffe5450684cfc7e1a2b (diff) | |
download | frameworks_base-9438ad1599716176fb6c593e77a2e93b265bbcb5.zip frameworks_base-9438ad1599716176fb6c593e77a2e93b265bbcb5.tar.gz frameworks_base-9438ad1599716176fb6c593e77a2e93b265bbcb5.tar.bz2 |
am e580d661: am e89a2865: Merge changes If2c7e09f,Ie21f227c
* commit 'e580d6617f67a1db5eff7ffe5450684cfc7e1a2b':
RRO idmap: pad with 0xffffffff, not 0x00000000
RRO: reintroduce lost ResTable insert of assets
Diffstat (limited to 'libs/androidfw')
-rw-r--r-- | libs/androidfw/AssetManager.cpp | 4 | ||||
-rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index e5c5b10..6188edb 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -302,6 +302,10 @@ bool AssetManager::addOverlayPath(const String8& packagePath, int32_t* cookie) mAssetPaths.add(oap); *cookie = static_cast<int32_t>(mAssetPaths.size()); + if (mResources != NULL) { + appendPathToResTable(oap); + } + return true; } diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index 04bf8b1..a951ffb 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -6255,14 +6255,14 @@ status_t ResTable::createIdmap(const ResTable& overlay, } if (typeMap.entryOffset + typeMap.entryMap.size() < entryIndex) { - // Resize to accomodate this entry and the 0's in between. - if (typeMap.entryMap.resize((entryIndex - typeMap.entryOffset) + 1) < 0) { + // pad with 0xffffffff's (indicating non-existing entries) before adding this entry + size_t index = typeMap.entryMap.size(); + size_t numItems = entryIndex - (typeMap.entryOffset + index); + if (typeMap.entryMap.insertAt(0xffffffff, index, numItems) < 0) { return NO_MEMORY; } - typeMap.entryMap.editTop() = Res_GETENTRY(overlayResID); - } else { - typeMap.entryMap.add(Res_GETENTRY(overlayResID)); } + typeMap.entryMap.add(Res_GETENTRY(overlayResID)); } if (!typeMap.entryMap.isEmpty()) { |