diff options
Diffstat (limited to 'libs/androidfw/ApkAssets.cpp')
-rw-r--r-- | libs/androidfw/ApkAssets.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp index 9a08f638f230..fe68ec01e4b7 100644 --- a/libs/androidfw/ApkAssets.cpp +++ b/libs/androidfw/ApkAssets.cpp @@ -27,16 +27,17 @@ namespace android { -std::unique_ptr<ApkAssets> ApkAssets::Load(const std::string& path) { - return ApkAssets::LoadImpl(path, false /*load_as_shared_library*/); +std::unique_ptr<const ApkAssets> ApkAssets::Load(const std::string& path, bool system) { + return ApkAssets::LoadImpl(path, system, false /*load_as_shared_library*/); } -std::unique_ptr<ApkAssets> ApkAssets::LoadAsSharedLibrary(const std::string& path) { - return ApkAssets::LoadImpl(path, true /*load_as_shared_library*/); +std::unique_ptr<const ApkAssets> ApkAssets::LoadAsSharedLibrary(const std::string& path, + bool system) { + return ApkAssets::LoadImpl(path, system, true /*load_as_shared_library*/); } -std::unique_ptr<ApkAssets> ApkAssets::LoadImpl(const std::string& path, - bool load_as_shared_library) { +std::unique_ptr<const ApkAssets> ApkAssets::LoadImpl(const std::string& path, bool system, + bool load_as_shared_library) { ATRACE_CALL(); ::ZipArchiveHandle unmanaged_handle; int32_t result = ::OpenArchive(path.c_str(), &unmanaged_handle); @@ -70,11 +71,13 @@ std::unique_ptr<ApkAssets> ApkAssets::LoadImpl(const std::string& path, loaded_apk->path_ = path; loaded_apk->loaded_arsc_ = LoadedArsc::Load(loaded_apk->resources_asset_->getBuffer(true /*wordAligned*/), - loaded_apk->resources_asset_->getLength(), load_as_shared_library); + loaded_apk->resources_asset_->getLength(), system, load_as_shared_library); if (loaded_apk->loaded_arsc_ == nullptr) { return {}; } - return loaded_apk; + + // Need to force a move for mingw32. + return std::move(loaded_apk); } std::unique_ptr<Asset> ApkAssets::Open(const std::string& path, Asset::AccessMode /*mode*/) const { |