summaryrefslogtreecommitdiff
path: root/libs/androidfw/ApkAssets.cpp
diff options
context:
space:
mode:
author Yurii Zubrytskyi <zyy@google.com> 2022-12-01 05:32:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-12-01 05:32:01 +0000
commit46b0752616f899f0dc0188f8a234449d2e6533d0 (patch)
tree7cccc1ed8d069e66266b3c2b04f4c19b93a04136 /libs/androidfw/ApkAssets.cpp
parent7b7f8aba2f2c6fca1b065bfe055a4c62d0dd472a (diff)
parent2ab4447ad20bdbf664c00de5f47c2c638ee83241 (diff)
Merge changes Ie5999dda,I2853cd3c,I7d9f1fe3,I19576654,I158af793, ...
* changes: [res] Don't stat asset providers on RO filesystems [res] Change OverlayableInfo to hold string views [res] Change staged alias container to vector [res] Change callback from function to function_ref [res] Reuse memory in RebuildFilterList() [res] Split keys and values in Theme::Entry vector [res] Properly create ZipAssetsProvider with fd
Diffstat (limited to 'libs/androidfw/ApkAssets.cpp')
-rw-r--r--[-rwxr-xr-x]libs/androidfw/ApkAssets.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp
index c0fa63a08fac..15aaae25f754 100755..100644
--- a/libs/androidfw/ApkAssets.cpp
+++ b/libs/androidfw/ApkAssets.cpp
@@ -18,6 +18,7 @@
#include "android-base/errors.h"
#include "android-base/logging.h"
+#include "android-base/utf8.h"
namespace android {
@@ -84,7 +85,7 @@ std::unique_ptr<ApkAssets> ApkAssets::LoadOverlay(const std::string& idmap_path,
}
std::string overlay_path(loaded_idmap->OverlayApkPath());
- auto fd = unique_fd(::open(overlay_path.c_str(), O_RDONLY|O_CLOEXEC));
+ auto fd = unique_fd(base::utf8::open(overlay_path.c_str(), O_RDONLY | O_CLOEXEC));
std::unique_ptr<AssetsProvider> overlay_assets;
if (IsFabricatedOverlay(fd)) {
// Fabricated overlays do not contain resource definitions. All of the overlay resource values
@@ -92,7 +93,7 @@ std::unique_ptr<ApkAssets> ApkAssets::LoadOverlay(const std::string& idmap_path,
overlay_assets = EmptyAssetsProvider::Create(std::move(overlay_path));
} else {
// The overlay should be an APK.
- overlay_assets = ZipAssetsProvider::Create(std::move(fd), std::move(overlay_path), flags);
+ overlay_assets = ZipAssetsProvider::Create(std::move(overlay_path), flags, std::move(fd));
}
if (overlay_assets == nullptr) {
return {};