summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-11-13 23:55:20 +0000
committerRyan Mitchell <rtmitchell@google.com>2020-11-13 23:55:20 +0000
commit55ef6167a2c235bd88c7216238b2001b46795b79 (patch)
tree5a63ff5e6b8a0ade4ce5aa2c4d663d62a7d993d9 /libs/androidfw/AssetManager.cpp
parent6ca48473e533a8b89abac6294a0bb8130b8c8c89 (diff)
Revert "libandroidfw hardening for IncFs"
Revert "Move map_ptr to incfs namspace" Revert submission 12787270 Reason for revert: b/173250495 Reverted Changes: I5cd1bc8a2:libandroidfw hardening for IncFs Ice5dbcfb2:Move map_ptr to incfs namspace I29ccdc8ed:Do not cache bag parent stack until requested I1e9e9acaa:Cache resolved theme values Change-Id: Ib90ef68339710086df41e9abe0833a542d03a74f
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
-rw-r--r--libs/androidfw/AssetManager.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index fb2b57193b83..f7c83371f79c 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -917,7 +917,7 @@ Asset* AssetManager::openAssetFromFileLocked(const String8& pathName,
Asset* AssetManager::openAssetFromZipLocked(const ZipFileRO* pZipFile,
const ZipEntryRO entry, AccessMode mode, const String8& entryName)
{
- std::unique_ptr<Asset> pAsset;
+ Asset* pAsset = NULL;
// TODO: look for previously-created shared memory slice?
uint16_t method;
@@ -932,28 +932,28 @@ Asset* AssetManager::openAssetFromZipLocked(const ZipFileRO* pZipFile,
return NULL;
}
- std::optional<incfs::IncFsFileMap> dataMap = pZipFile->createEntryIncFsFileMap(entry);
- if (!dataMap.has_value()) {
+ FileMap* dataMap = pZipFile->createEntryFileMap(entry);
+ if (dataMap == NULL) {
ALOGW("create map from entry failed\n");
return NULL;
}
if (method == ZipFileRO::kCompressStored) {
- pAsset = Asset::createFromUncompressedMap(std::move(*dataMap), mode);
+ pAsset = Asset::createFromUncompressedMap(dataMap, mode);
ALOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(),
- dataMap->file_name(), mode, pAsset.get());
+ dataMap->getFileName(), mode, pAsset);
} else {
- pAsset = Asset::createFromCompressedMap(std::move(*dataMap),
+ pAsset = Asset::createFromCompressedMap(dataMap,
static_cast<size_t>(uncompressedLen), mode);
ALOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(),
- dataMap->file_name(), mode, pAsset.get());
+ dataMap->getFileName(), mode, pAsset);
}
if (pAsset == NULL) {
/* unexpected */
ALOGW("create from segment failed\n");
}
- return pAsset.release();
+ return pAsset;
}
/*