diff options
author | Bill Peckham <bpeckham@google.com> | 2018-11-05 17:12:23 -0800 |
---|---|---|
committer | Bill Peckham <bpeckham@google.com> | 2018-11-05 17:12:23 -0800 |
commit | ba167de93776a7e5d1b347d1ee646e161cf24ce5 (patch) | |
tree | f1ced04b88bd977af08011e6c7e4124ebe8aa293 /libs/androidfw/AssetManager2.cpp | |
parent | f893260618712d3894d1279e27ee121d4be8817f (diff) | |
parent | 828551df83149d4b5754757d8b2dc36f55f24cad (diff) |
Merge QP1A.181022.001
Change-Id: I0e200ff664739f0bce5a55806ac4fc95fbbff52d
Diffstat (limited to 'libs/androidfw/AssetManager2.cpp')
-rw-r--r-- | libs/androidfw/AssetManager2.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp index 9c1629bc36f5..04cc5bb30ade 100644 --- a/libs/androidfw/AssetManager2.cpp +++ b/libs/androidfw/AssetManager2.cpp @@ -67,10 +67,10 @@ AssetManager2::AssetManager2() { } bool AssetManager2::SetApkAssets(const std::vector<const ApkAssets*>& apk_assets, - bool invalidate_caches) { + bool invalidate_caches, bool filter_incompatible_configs) { apk_assets_ = apk_assets; BuildDynamicRefTable(); - RebuildFilterList(); + RebuildFilterList(filter_incompatible_configs); if (invalidate_caches) { InvalidateCaches(static_cast<uint32_t>(-1)); } @@ -825,7 +825,7 @@ uint32_t AssetManager2::GetResourceId(const std::string& resource_name, return 0u; } -void AssetManager2::RebuildFilterList() { +void AssetManager2::RebuildFilterList(bool filter_incompatible_configs) { for (PackageGroup& group : package_groups_) { for (ConfiguredPackage& impl : group.packages_) { // Destroy it. @@ -841,7 +841,7 @@ void AssetManager2::RebuildFilterList() { for (auto iter = spec->types; iter != iter_end; ++iter) { ResTable_config this_config; this_config.copyFromDtoH((*iter)->config); - if (this_config.match(configuration_)) { + if (!filter_incompatible_configs || this_config.match(configuration_)) { group.configurations.push_back(this_config); group.types.push_back(*iter); } |