Revert "[res] Don't recalculate configuration twice on init"
This reverts commit 8bd3903dd88a7ff0f5beb76f4a2bfa007857f399.
Reason for revert: DroidMonitor: Potential culprit for Bug X - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: Ia02ae2d9f359b540393a9f63d9282447b88a0a10
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index 46f636e..8748dab 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -117,10 +117,6 @@
return true;
}
-void AssetManager2::PresetApkAssets(ApkAssetsList apk_assets) {
- BuildDynamicRefTable(apk_assets);
-}
-
bool AssetManager2::SetApkAssets(std::initializer_list<ApkAssetsPtr> apk_assets,
bool invalidate_caches) {
return SetApkAssets(ApkAssetsList(apk_assets.begin(), apk_assets.size()), invalidate_caches);
@@ -436,18 +432,13 @@
return false;
}
-void AssetManager2::SetConfigurations(std::vector<ResTable_config> configurations,
- bool force_refresh) {
+void AssetManager2::SetConfigurations(std::vector<ResTable_config> configurations) {
int diff = 0;
- if (force_refresh) {
+ if (configurations_.size() != configurations.size()) {
diff = -1;
} else {
- if (configurations_.size() != configurations.size()) {
- diff = -1;
- } else {
- for (int i = 0; i < configurations_.size(); i++) {
- diff |= configurations_[i].diff(configurations[i]);
- }
+ for (int i = 0; i < configurations_.size(); i++) {
+ diff |= configurations_[i].diff(configurations[i]);
}
}
configurations_ = std::move(configurations);
@@ -784,7 +775,8 @@
bool has_locale = false;
if (result->config.locale == 0) {
if (default_locale_ != 0) {
- ResTable_config conf = {.locale = default_locale_};
+ ResTable_config conf;
+ conf.locale = default_locale_;
// Since we know conf has a locale and only a locale, match will tell us if that locale
// matches
has_locale = conf.match(config);