diff options
Diffstat (limited to 'include/androidfw/AssetManager.h')
| -rw-r--r-- | include/androidfw/AssetManager.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h index 503377cf7ae8..a13dd16fc736 100644 --- a/include/androidfw/AssetManager.h +++ b/include/androidfw/AssetManager.h @@ -70,6 +70,12 @@ struct ResTable_config; class AssetManager : public AAssetManager { public: static const char* RESOURCES_FILENAME; + static const char* IDMAP_BIN; + static const char* OVERLAY_DIR; + static const char* TARGET_PACKAGE_NAME; + static const char* TARGET_APK_PATH; + static const char* IDMAP_DIR; + typedef enum CacheMode { CACHE_UNKNOWN = 0, CACHE_OFF, // don't try to cache file locations @@ -94,6 +100,7 @@ public: * newly-added asset source. */ bool addAssetPath(const String8& path, int32_t* cookie); + bool addOverlayPath(const String8& path, int32_t* cookie); /* * Convenience for adding the standard system assets. Uses the @@ -272,19 +279,14 @@ private: void setLocaleLocked(const char* locale); void updateResourceParamsLocked() const; - bool createIdmapFileLocked(const String8& originalPath, const String8& overlayPath, - const String8& idmapPath); - - bool isIdmapStaleLocked(const String8& originalPath, const String8& overlayPath, - const String8& idmapPath); - Asset* openIdmapLocked(const struct asset_path& ap) const; - bool getZipEntryCrcLocked(const String8& zipPath, const char* entryFilename, uint32_t* pCrc); + void addSystemOverlays(const char* pathOverlaysList, const String8& targetPackagePath, + ResTable* sharedRes, size_t offset) const; class SharedZip : public RefBase { public: - static sp<SharedZip> get(const String8& path); + static sp<SharedZip> get(const String8& path, bool createIfNotPresent = true); ZipFileRO* getZip(); @@ -295,6 +297,9 @@ private: ResTable* setResourceTable(ResTable* res); bool isUpToDate(); + + void addOverlay(const asset_path& ap); + bool getOverlay(size_t idx, asset_path* out) const; protected: ~SharedZip(); @@ -310,6 +315,8 @@ private: Asset* mResourceTableAsset; ResTable* mResourceTable; + Vector<asset_path> mOverlays; + static Mutex gLock; static DefaultKeyedVector<String8, wp<SharedZip> > gOpen; }; @@ -342,6 +349,9 @@ private: static String8 getPathName(const char* path); 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); |