summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-02-12 14:41:25 -0800
committerNick Kralevich <nnk@google.com>2014-02-12 14:41:25 -0800
commitd5c8044e7e1f1402fdd4a035690329294ab07b33 (patch)
tree7963a5beae4395899c6b3892d18f1fd8f08e9606 /include
parentcbdec7dd8c45f70c678029783ab2f5657f6b36bd (diff)
parent1cbea39fe1740d7d1c3e4aa0e4771a99a56c79ef (diff)
downloadframeworks_base-d5c8044e7e1f1402fdd4a035690329294ab07b33.zip
frameworks_base-d5c8044e7e1f1402fdd4a035690329294ab07b33.tar.gz
frameworks_base-d5c8044e7e1f1402fdd4a035690329294ab07b33.tar.bz2
resolved conflicts for merge of 1cbea39f to master
Change-Id: Ib33484546c6a03cbc4cd96e97d9d785d68e10700
Diffstat (limited to 'include')
-rw-r--r--include/androidfw/AssetManager.h26
-rw-r--r--include/androidfw/ResourceTypes.h24
2 files changed, 21 insertions, 29 deletions
diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h
index 503377c..a13dd16 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);
diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h
index 0f51826..a0bae12 100644
--- a/include/androidfw/ResourceTypes.h
+++ b/include/androidfw/ResourceTypes.h
@@ -1638,39 +1638,21 @@ public:
// Return value: on success: NO_ERROR; caller is responsible for free-ing
// outData (using free(3)). On failure, any status_t value other than
// NO_ERROR; the caller should not free outData.
- status_t createIdmap(const ResTable& overlay, uint32_t targetCrc, uint32_t overlayCrc,
- void** outData, size_t* outSize) const;
-
status_t createIdmap(const ResTable& overlay,
uint32_t targetCrc, uint32_t overlayCrc,
const char* targetPath, const char* overlayPath,
- void** outData, size_t* outSize) const
- {
- (void)targetPath;
- (void)overlayPath;
- return createIdmap(overlay, targetCrc, overlayCrc, outData, outSize);
- }
+ void** outData, size_t* outSize) const;
enum {
- IDMAP_HEADER_SIZE_BYTES = 3 * sizeof(uint32_t),
+ IDMAP_HEADER_SIZE_BYTES = 3 * sizeof(uint32_t) + 2 * 256,
};
// Retrieve idmap meta-data.
//
// This function only requires the idmap header (the first
// IDMAP_HEADER_SIZE_BYTES) bytes of an idmap file.
static bool getIdmapInfo(const void* idmap, size_t size,
- uint32_t* pTargetCrc, uint32_t* pOverlayCrc);
-
- static bool getIdmapInfo(const void* idmap, size_t size,
uint32_t* pTargetCrc, uint32_t* pOverlayCrc,
- String8* pTargetPath, String8* pOverlayPath)
- {
- if (*pTargetPath)
- *pTargetPath = String8();
- if (*pOverlayPath)
- *pOverlayPath = String8();
- return getIdmapInfo(idmap, size, pTargetCrc, pOverlayCrc);
- }
+ String8* pTargetPath, String8* pOverlayPath);
void print(bool inclValues) const;
static String8 normalizeForOutput(const char* input);