summaryrefslogtreecommitdiff
path: root/tools/aapt2/process
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/process')
-rw-r--r--tools/aapt2/process/SymbolTable.cpp12
-rw-r--r--tools/aapt2/process/SymbolTable.h2
2 files changed, 4 insertions, 10 deletions
diff --git a/tools/aapt2/process/SymbolTable.cpp b/tools/aapt2/process/SymbolTable.cpp
index bca62da447b0..b75458a7b8b6 100644
--- a/tools/aapt2/process/SymbolTable.cpp
+++ b/tools/aapt2/process/SymbolTable.cpp
@@ -220,15 +220,9 @@ std::unique_ptr<SymbolTable::Symbol> ResourceTableSymbolSource::FindByName(
bool AssetManagerSymbolSource::AddAssetPath(StringPiece path) {
TRACE_CALL();
- if (std::unique_ptr<const ApkAssets> apk = ApkAssets::Load(path.data())) {
+ if (auto apk = ApkAssets::Load(path.data())) {
apk_assets_.push_back(std::move(apk));
-
- std::vector<const ApkAssets*> apk_assets;
- for (const std::unique_ptr<const ApkAssets>& apk_asset : apk_assets_) {
- apk_assets.push_back(apk_asset.get());
- }
-
- asset_manager_.SetApkAssets(apk_assets);
+ asset_manager_.SetApkAssets(apk_assets_);
return true;
}
return false;
@@ -251,7 +245,7 @@ bool AssetManagerSymbolSource::IsPackageDynamic(uint32_t packageId,
return true;
}
- for (const std::unique_ptr<const ApkAssets>& assets : apk_assets_) {
+ for (auto&& assets : apk_assets_) {
for (const std::unique_ptr<const android::LoadedPackage>& loaded_package
: assets->GetLoadedArsc()->GetPackages()) {
if (package_name == loaded_package->GetPackageName() && loaded_package->IsDynamic()) {
diff --git a/tools/aapt2/process/SymbolTable.h b/tools/aapt2/process/SymbolTable.h
index b09ff702ca58..36eb0bab6046 100644
--- a/tools/aapt2/process/SymbolTable.h
+++ b/tools/aapt2/process/SymbolTable.h
@@ -207,8 +207,8 @@ class AssetManagerSymbolSource : public ISymbolSource {
}
private:
+ std::vector<android::AssetManager2::ApkAssetsPtr> apk_assets_;
android::AssetManager2 asset_manager_;
- std::vector<std::unique_ptr<const android::ApkAssets>> apk_assets_;
DISALLOW_COPY_AND_ASSIGN(AssetManagerSymbolSource);
};