diff options
| author | 2020-03-10 13:49:12 -0700 | |
|---|---|---|
| committer | 2020-03-19 18:33:55 -0700 | |
| commit | c07aa702703388747bd6e9b1091127e2736ffcd8 (patch) | |
| tree | 9d2f3a07e88e7d5a2ef367c4b8d95c81e07cb576 /libs/androidfw/AssetManager2.cpp | |
| parent | 349695f3701e90746cb2197552299dcb99960ce8 (diff) | |
Add ResourcesProvider.loadFromDirectory
This API allows a directory to be loaded as if it was a zipped APK.
This is a substitute for the DirectoryAssetProvider API that
currently does not work in the native layer.
Bug: 142716192
Test: atest FrameworksResourceLoaderTests
Change-Id: Ia13e15653e75b421423dd56f9fe89e183ab4cb9a
Diffstat (limited to 'libs/androidfw/AssetManager2.cpp')
| -rw-r--r-- | libs/androidfw/AssetManager2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp index 32086625a726..f20e18453f8b 100644 --- a/libs/androidfw/AssetManager2.cpp +++ b/libs/androidfw/AssetManager2.cpp @@ -463,7 +463,7 @@ std::unique_ptr<AssetDir> AssetManager2::OpenDir(const std::string& dirname) con files->add(info); }; - if (!apk_assets->ForEachFile(full_path, func)) { + if (!apk_assets->GetAssetsProvider()->ForEachFile(full_path, func)) { return {}; } } @@ -487,7 +487,7 @@ std::unique_ptr<Asset> AssetManager2::OpenNonAsset(const std::string& filename, continue; } - std::unique_ptr<Asset> asset = apk_assets_[i]->Open(filename, mode); + std::unique_ptr<Asset> asset = apk_assets_[i]->GetAssetsProvider()->Open(filename, mode); if (asset) { if (out_cookie != nullptr) { *out_cookie = i; @@ -508,7 +508,7 @@ std::unique_ptr<Asset> AssetManager2::OpenNonAsset(const std::string& filename, if (cookie < 0 || static_cast<size_t>(cookie) >= apk_assets_.size()) { return {}; } - return apk_assets_[cookie]->Open(filename, mode); + return apk_assets_[cookie]->GetAssetsProvider()->Open(filename, mode); } ApkAssetsCookie AssetManager2::FindEntry(uint32_t resid, uint16_t density_override, |