summaryrefslogtreecommitdiffstats
path: root/libs/androidfw
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-10-26 21:26:58 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-10-27 10:21:45 -0700
commit1825bd2d90d3fa2567212870c2c53a5001fc1b6b (patch)
tree5902e1d696bd4b4d35878354d38b73f5dd401d31 /libs/androidfw
parent3b375ca9d95321eb23e02ec5952a7cbb7c4195ad (diff)
downloadframeworks_base-1825bd2d90d3fa2567212870c2c53a5001fc1b6b.zip
frameworks_base-1825bd2d90d3fa2567212870c2c53a5001fc1b6b.tar.gz
frameworks_base-1825bd2d90d3fa2567212870c2c53a5001fc1b6b.tar.bz2
Themes: Remove entryIdx param from appendPathToResTable
Change-Id: Ia7e3d0462e7d9cf67024f14a3a36b0ad54dad527
Diffstat (limited to 'libs/androidfw')
-rw-r--r--libs/androidfw/AssetManager.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 2ce8d0b..413ae53 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -266,7 +266,7 @@ bool AssetManager::addAssetPath(const String8& path, int32_t* cookie)
#endif
if (mResources != NULL) {
- appendPathToResTable(ap, NULL);
+ appendPathToResTable(ap);
}
return true;
@@ -357,7 +357,7 @@ bool AssetManager::addOverlayPath(const String8& packagePath, int32_t* cookie,
*cookie = static_cast<int32_t>(mAssetPaths.size());
if (mResources != NULL) {
- appendPathToResTable(oap, NULL);
+ appendPathToResTable(oap);
}
return true;
@@ -388,8 +388,7 @@ bool AssetManager::addCommonOverlayPath(const String8& packagePath, int32_t* coo
*cookie = static_cast<int32_t>(mAssetPaths.size());
if (mResources != NULL) {
- size_t index = mAssetPaths.size() - 1;
- appendPathToResTable(oap, &index);
+ appendPathToResTable(oap);
}
return true;
@@ -440,8 +439,7 @@ bool AssetManager::addIconPath(const String8& packagePath, int32_t* cookie,
*cookie = static_cast<int32_t>(mAssetPaths.size());
if (mResources != NULL) {
- size_t index = mAssetPaths.size() - 1;
- appendPathToResTable(oap, &index);
+ appendPathToResTable(oap);
}
return true;
@@ -846,7 +844,7 @@ FileType AssetManager::getFileType(const char* fileName)
return kFileTypeRegular;
}
-bool AssetManager::appendPathToResTable(const asset_path& ap, size_t* entryIdx) const {
+bool AssetManager::appendPathToResTable(const asset_path& ap) const {
// skip those ap's that correspond to system overlays
if (ap.isSystemOverlay) {
return true;
@@ -865,7 +863,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap, size_t* entryIdx)
ass = const_cast<AssetManager*>(this)->openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap, false);
shared = false;
} else if (ap.type != kFileTypeDirectory) {
- if (*entryIdx == 0) {
+ if (nextEntryIdx == 0) {
// The first item is typically the framework resources,
// which we want to avoid parsing every time.
sharedRes = const_cast<AssetManager*>(this)->
@@ -896,7 +894,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap, size_t* entryIdx)
// can quickly copy it out for others.
ALOGV("Creating shared resources for %s", ap.path.string());
sharedRes = new ResTable();
- sharedRes->add(ass, idmap, *entryIdx + 1, false, ap.pkgIdOverride);
+ sharedRes->add(ass, idmap, nextEntryIdx + 1, false, ap.pkgIdOverride);
#ifdef HAVE_ANDROID_OS
const char* data = getenv("ANDROID_DATA");
LOG_ALWAYS_FATAL_IF(data == NULL, "ANDROID_DATA not set");
@@ -925,7 +923,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap, size_t* entryIdx)
mResources->add(sharedRes);
} else {
ALOGV("Parsing resources for %s", ap.path.string());
- mResources->add(ass, idmap, *entryIdx + 1, !shared, ap.pkgIdOverride);
+ mResources->add(ass, idmap, nextEntryIdx + 1, !shared, ap.pkgIdOverride);
}
onlyEmptyResources = false;
@@ -974,7 +972,7 @@ const ResTable* AssetManager::getResTable(bool required) const
bool onlyEmptyResources = true;
const size_t N = mAssetPaths.size();
for (size_t i=0; i<N; i++) {
- bool empty = appendPathToResTable(mAssetPaths.itemAt(i), &i);
+ bool empty = appendPathToResTable(mAssetPaths.itemAt(i));
onlyEmptyResources = onlyEmptyResources && empty;
}