summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
-rw-r--r--libs/androidfw/AssetManager.cpp104
1 files changed, 0 insertions, 104 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index acacd7654cf1..84111ae0d499 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -202,15 +202,6 @@ bool AssetManager::addAssetPath(
*cookie = static_cast<int32_t>(mAssetPaths.size());
}
-#ifdef __ANDROID__
- // Load overlays, if any
- asset_path oap;
- for (size_t idx = 0; mZipSet.getOverlay(ap.path, idx, &oap); idx++) {
- oap.isSystemAsset = isSystemAsset;
- mAssetPaths.add(oap);
- }
-#endif
-
if (mResources != NULL) {
appendPathToResTable(ap, appAsLib);
}
@@ -493,11 +484,6 @@ FileType AssetManager::getFileType(const char* fileName)
}
bool AssetManager::appendPathToResTable(const asset_path& ap, bool appAsLib) const {
- // skip those ap's that correspond to system overlays
- if (ap.isSystemOverlay) {
- return true;
- }
-
Asset* ass = NULL;
ResTable* sharedRes = NULL;
bool shared = true;
@@ -539,14 +525,6 @@ bool AssetManager::appendPathToResTable(const asset_path& ap, bool appAsLib) con
ALOGV("Creating shared resources for %s", ap.path.string());
sharedRes = new ResTable();
sharedRes->add(ass, idmap, nextEntryIdx + 1, false);
-#ifdef __ANDROID__
- const char* data = getenv("ANDROID_DATA");
- LOG_ALWAYS_FATAL_IF(data == NULL, "ANDROID_DATA not set");
- String8 overlaysListPath(data);
- overlaysListPath.appendPath(kResourceCache);
- overlaysListPath.appendPath("overlays.list");
- addSystemOverlays(overlaysListPath.string(), ap.path, sharedRes, nextEntryIdx);
-#endif
sharedRes = const_cast<AssetManager*>(this)->
mZipSet.setZipResourceTable(ap.path, sharedRes);
}
@@ -655,58 +633,6 @@ Asset* AssetManager::openIdmapLocked(const struct asset_path& ap) const
return ass;
}
-void AssetManager::addSystemOverlays(const char* pathOverlaysList,
- const String8& targetPackagePath, ResTable* sharedRes, size_t offset) const
-{
- FILE* fin = fopen(pathOverlaysList, "r");
- if (fin == NULL) {
- return;
- }
-
-#ifndef _WIN32
- if (TEMP_FAILURE_RETRY(flock(fileno(fin), LOCK_SH)) != 0) {
- fclose(fin);
- return;
- }
-#endif
- char buf[1024];
- while (fgets(buf, sizeof(buf), fin)) {
- // format of each line:
- // <path to apk><space><path to idmap><newline>
- char* space = strchr(buf, ' ');
- char* newline = strchr(buf, '\n');
- asset_path oap;
-
- if (space == NULL || newline == NULL || newline < space) {
- continue;
- }
-
- oap.path = String8(buf, space - buf);
- oap.type = kFileTypeRegular;
- oap.idmap = String8(space + 1, newline - space - 1);
- oap.isSystemOverlay = true;
-
- Asset* oass = const_cast<AssetManager*>(this)->
- openNonAssetInPathLocked("resources.arsc",
- Asset::ACCESS_BUFFER,
- oap);
-
- if (oass != NULL) {
- Asset* oidmap = openIdmapLocked(oap);
- offset++;
- sharedRes->add(oass, oidmap, offset + 1, false);
- const_cast<AssetManager*>(this)->mAssetPaths.add(oap);
- const_cast<AssetManager*>(this)->mZipSet.addOverlay(targetPackagePath, oap);
- delete oidmap;
- }
- }
-
-#ifndef _WIN32
- TEMP_FAILURE_RETRY(flock(fileno(fin), LOCK_UN));
-#endif
- fclose(fin);
-}
-
const ResTable& AssetManager::getResources(bool required) const
{
const ResTable* rt = getResTable(required);
@@ -1446,20 +1372,6 @@ bool AssetManager::SharedZip::isUpToDate()
return mModWhen == modWhen;
}
-void AssetManager::SharedZip::addOverlay(const asset_path& ap)
-{
- mOverlays.add(ap);
-}
-
-bool AssetManager::SharedZip::getOverlay(size_t idx, asset_path* out) const
-{
- if (idx >= mOverlays.size()) {
- return false;
- }
- *out = mOverlays[idx];
- return true;
-}
-
AssetManager::SharedZip::~SharedZip()
{
if (kIsDebug) {
@@ -1578,22 +1490,6 @@ bool AssetManager::ZipSet::isUpToDate()
return true;
}
-void AssetManager::ZipSet::addOverlay(const String8& path, const asset_path& overlay)
-{
- int idx = getIndex(path);
- sp<SharedZip> zip = mZipFile[idx];
- zip->addOverlay(overlay);
-}
-
-bool AssetManager::ZipSet::getOverlay(const String8& path, size_t idx, asset_path* out) const
-{
- sp<SharedZip> zip = SharedZip::get(path, false);
- if (zip == NULL) {
- return false;
- }
- return zip->getOverlay(idx, out);
-}
-
/*
* Compute the zip file's index.
*