From 7de2f9c73fbe93bfb7dff3c046cf7a3137599f6c Mon Sep 17 00:00:00 2001 From: Jaekyun Seok Date: Thu, 2 Mar 2017 12:45:10 +0900 Subject: Reinstate codes to enable RRO on system server Test: building succeeded and tested with sailfish Bug: 35742444 Change-Id: I99d0f1d097525d3eb46255d6cf823f6ae2a02385 --- libs/androidfw/include/androidfw/AssetManager.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libs/androidfw/include') diff --git a/libs/androidfw/include/androidfw/AssetManager.h b/libs/androidfw/include/androidfw/AssetManager.h index f1e8b9364915..becd307d114d 100644 --- a/libs/androidfw/include/androidfw/AssetManager.h +++ b/libs/androidfw/include/androidfw/AssetManager.h @@ -202,10 +202,12 @@ public: private: struct asset_path { - asset_path() : path(""), type(kFileTypeRegular), idmap(""), isSystemAsset(false) {} + asset_path() : path(""), type(kFileTypeRegular), idmap(""), + isSystemOverlay(false), isSystemAsset(false) {} String8 path; FileType type; String8 idmap; + bool isSystemOverlay; bool isSystemAsset; }; @@ -235,6 +237,9 @@ private: Asset* openIdmapLocked(const struct asset_path& ap) const; + void addSystemOverlays(const char* pathOverlaysList, const String8& targetPackagePath, + ResTable* sharedRes, size_t offset) const; + class SharedZip : public RefBase { public: static sp get(const String8& path, bool createIfNotPresent = true); @@ -249,6 +254,9 @@ private: bool isUpToDate(); + void addOverlay(const asset_path& ap); + bool getOverlay(size_t idx, asset_path* out) const; + protected: ~SharedZip(); @@ -263,6 +271,8 @@ private: Asset* mResourceTableAsset; ResTable* mResourceTable; + Vector mOverlays; + static Mutex gLock; static DefaultKeyedVector > gOpen; }; @@ -296,6 +306,9 @@ private: bool isUpToDate(); + void addOverlay(const String8& path, const asset_path& overlay); + bool getOverlay(const String8& path, size_t idx, asset_path* out) const; + private: void closeZip(int idx); -- cgit v1.2.3-59-g8ed1b