diff options
author | Adam Lesinski <adamlesinski@google.com> | 2014-12-04 09:21:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-04 09:21:45 +0000 |
commit | 8e5362f20e2bc41b1dcf130a613b7e0b3cd1db58 (patch) | |
tree | e395d9177a329782dd5be2a5ec228b1abe3093a2 | |
parent | c0707c007d8322338e9f46f5ccb04b5582e75845 (diff) | |
parent | 503071ae41374a66f61e53e05a91243473db83b9 (diff) | |
download | frameworks_base-8e5362f20e2bc41b1dcf130a613b7e0b3cd1db58.zip frameworks_base-8e5362f20e2bc41b1dcf130a613b7e0b3cd1db58.tar.gz frameworks_base-8e5362f20e2bc41b1dcf130a613b7e0b3cd1db58.tar.bz2 |
am 503071ae: am a2b5067a: Merge "RRO: prevent duplicate system overlays"
* commit '503071ae41374a66f61e53e05a91243473db83b9':
RRO: prevent duplicate system overlays
-rw-r--r-- | include/androidfw/AssetManager.h | 2 | ||||
-rw-r--r-- | libs/androidfw/AssetManager.cpp | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h index 99b3195..0cfd2b1 100644 --- a/include/androidfw/AssetManager.h +++ b/include/androidfw/AssetManager.h @@ -236,9 +236,11 @@ public: private: struct asset_path { + asset_path() : path(""), type(kFileTypeRegular), idmap(""), isSystemOverlay(false) {} String8 path; FileType type; String8 idmap; + bool isSystemOverlay; }; Asset* openInPathLocked(const char* fileName, AccessMode mode, diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index 6188edb..25cd363 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -611,6 +611,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; @@ -796,6 +801,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", |