summaryrefslogtreecommitdiff
path: root/libs/androidfw/ApkAssets.cpp
diff options
context:
space:
mode:
author Yurii Zubrytskyi <zyy@google.com> 2024-02-29 20:06:17 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-02-29 20:06:17 +0000
commitcb5c34af4ba852aa1fbd354cba493bb97a46c47a (patch)
treea76393b62f99ba3750381a22e0c01caafae83d00 /libs/androidfw/ApkAssets.cpp
parent83995ffa4b582aadd2e657ae6f14bbccfc9612d8 (diff)
parente7c1f00739c0f2747acb353ccef2b41f2a92a01e (diff)
Merge "[res] Use fstat() for idmap::IsUpToDate()" into main
Diffstat (limited to 'libs/androidfw/ApkAssets.cpp')
-rw-r--r--libs/androidfw/ApkAssets.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp
index f0c639574a9f..49254d1c6f6e 100644
--- a/libs/androidfw/ApkAssets.cpp
+++ b/libs/androidfw/ApkAssets.cpp
@@ -81,7 +81,7 @@ ApkAssetsPtr ApkAssets::LoadOverlay(const std::string& idmap_path, package_prope
std::string overlay_path(loaded_idmap->OverlayApkPath());
auto fd = unique_fd(base::utf8::open(overlay_path.c_str(), O_RDONLY | O_CLOEXEC));
std::unique_ptr<AssetsProvider> overlay_assets;
- if (IsFabricatedOverlay(fd)) {
+ if (IsFabricatedOverlayName(overlay_path) && IsFabricatedOverlay(fd)) {
// Fabricated overlays do not contain resource definitions. All of the overlay resource values
// are defined inline in the idmap.
overlay_assets = EmptyAssetsProvider::Create(std::move(overlay_path));
@@ -137,8 +137,7 @@ ApkAssetsPtr ApkAssets::LoadImpl(std::unique_ptr<Asset> resources_asset,
return {};
}
loaded_arsc = LoadedArsc::Load(data, length, loaded_idmap.get(), property_flags);
- } else if (loaded_idmap != nullptr &&
- IsFabricatedOverlay(std::string(loaded_idmap->OverlayApkPath()))) {
+ } else if (loaded_idmap != nullptr && IsFabricatedOverlay(loaded_idmap->OverlayApkPath())) {
loaded_arsc = LoadedArsc::Load(loaded_idmap.get());
} else {
loaded_arsc = LoadedArsc::CreateEmpty();