summaryrefslogtreecommitdiffstats
path: root/include/androidfw/AssetManager.h
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-01-27 11:17:22 +0000
committerNarayan Kamath <narayan@google.com>2014-01-27 11:20:24 +0000
commit745d4efc8369d255341d810790132660e33d3b61 (patch)
treef28ae30721d932409fd8189ac6ef5c0289d106c2 /include/androidfw/AssetManager.h
parent9fc157a4767f54d1cff53dc9489638b67aec2da3 (diff)
downloadframeworks_base-745d4efc8369d255341d810790132660e33d3b61.zip
frameworks_base-745d4efc8369d255341d810790132660e33d3b61.tar.gz
frameworks_base-745d4efc8369d255341d810790132660e33d3b61.tar.bz2
AssetManager cookies should be int32_t and not void*.
Cookies are really indices into vectors and arrays, so they don't need to be void*. We choose int32_t instead of size_t to allow their width to be well specified. (cherry picked from commit ebfdd0f467e39c3af8d92cade78263935340acb7) (cherry picked from commit a7fa2e592e2e579e5acdb903dba83fc074ebc215) (cherry picked from commit a9d5701b034ed2d9771b3f0943e1add00741d7cd) Change-Id: I2aed3db568b6fdc487bf99e2c5dd123206736fda
Diffstat (limited to 'include/androidfw/AssetManager.h')
-rw-r--r--include/androidfw/AssetManager.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h
index d95b45e..a010957 100644
--- a/include/androidfw/AssetManager.h
+++ b/include/androidfw/AssetManager.h
@@ -92,7 +92,7 @@ public:
* then on success, *cookie is set to the value corresponding to the
* newly-added asset source.
*/
- bool addAssetPath(const String8& path, void** cookie);
+ bool addAssetPath(const String8& path, int32_t* cookie);
/*
* Convenience for adding the standard system assets. Uses the
@@ -103,17 +103,17 @@ public:
/*
* Iterate over the asset paths in this manager. (Previously
* added via addAssetPath() and addDefaultAssets().) On first call,
- * 'cookie' must be NULL, resulting in the first cookie being returned.
- * Each next cookie will be returned there-after, until NULL indicating
+ * 'cookie' must be 0, resulting in the first cookie being returned.
+ * Each next cookie will be returned there-after, until -1 indicating
* the end has been reached.
*/
- void* nextAssetPath(void* cookie) const;
+ int32_t nextAssetPath(const int32_t cookie) const;
/*
* Return an asset path in the manager. 'which' must be between 0 and
* countAssetPaths().
*/
- String8 getAssetPath(void* cookie) const;
+ String8 getAssetPath(const int32_t cookie) const;
/*
* Set the current locale and vendor. The locale can change during
@@ -159,7 +159,7 @@ public:
* Explicit non-asset file. The file explicitly named by the cookie (the
* resource set to look in) and fileName will be opened and returned.
*/
- Asset* openNonAsset(void* cookie, const char* fileName, AccessMode mode);
+ Asset* openNonAsset(const int32_t cookie, const char* fileName, AccessMode mode);
/*
* Open a directory within the asset hierarchy.
@@ -183,7 +183,7 @@ public:
*
* To open the top-level directory, pass in "".
*/
- AssetDir* openNonAssetDir(void* cookie, const char* dirName);
+ AssetDir* openNonAssetDir(const int32_t cookie, const char* dirName);
/*
* Get the type of a file in the asset hierarchy. They will either