summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
author MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> 2014-11-07 10:57:15 +0100
committer Zoran Jovanovic <zoran.jovanovic@sonymobile.com> 2014-11-07 16:08:22 +0100
commitcb7b63d928cd562ea66d10d816056b984f50193a (patch)
tree0078c4cd3321ca9d533432f7092da58d2a6fa2f0 /libs/androidfw/AssetManager.cpp
parent96198ebae8deab14b434645f628213db492abdbc (diff)
RRO: prevent duplicate system overlays
System overlays, ie overlays with targetPackage="android", were loaded twice, which caused all sorts of issues. Ensure they are only loaded once, which will be during Zygote initialization. Bug: 17765434 Change-Id: Ia5064045c77f713c58fb78adc3942f6af1abdc93
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
-rw-r--r--libs/androidfw/AssetManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index a1f78589b804..542cd93c8cf1 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -605,6 +605,11 @@ FileType AssetManager::getFileType(const char* fileName)
}
bool AssetManager::appendPathToResTable(const asset_path& ap) const {
+ // skip those ap's that correspond to system overlays
+ if (ap.isSystemOverlay) {
+ return true;
+ }
+
Asset* ass = NULL;
ResTable* sharedRes = NULL;
bool shared = true;
@@ -790,6 +795,7 @@ void AssetManager::addSystemOverlays(const char* pathOverlaysList,
oap.path = String8(buf, space - buf);
oap.type = kFileTypeRegular;
oap.idmap = String8(space + 1, newline - space - 1);
+ oap.isSystemOverlay = true;
Asset* oass = const_cast<AssetManager*>(this)->
openNonAssetInPathLocked("resources.arsc",