summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2022-10-12 06:24:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-10-12 06:24:56 +0000
commitdb8b1f3ae871f1d9dad8d9c47c8e20a6bf1bca5d (patch)
treeb7cb8bc9885bcd0314c1aa9dbb4befab7bccc158 /libs
parent424153d91d9f09bd822c7e64b03956ee82accaa7 (diff)
parent0776b3b410c86dd8f739097d3c53bc3ec7d5679a (diff)
Merge changes I59ff27da,Icf74770b
* changes: [sysui] Use weak reference for the listener in NavigationBarTransitions Ensure no duplicates in ThemeKey
Diffstat (limited to 'libs')
-rw-r--r--libs/androidfw/AssetManager2.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index 235700b27c25..1381bdd6a50d 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -1068,7 +1068,7 @@ base::expected<const ResolvedBag*, NullOrIOError> AssetManager2::ResolveBag(
base::expected<const ResolvedBag*, NullOrIOError> AssetManager2::GetBag(uint32_t resid) const {
std::vector<uint32_t> found_resids;
const auto bag = GetBag(resid, found_resids);
- cached_bag_resid_stacks_.emplace(resid, found_resids);
+ cached_bag_resid_stacks_.emplace(resid, std::move(found_resids));
return bag;
}
@@ -1468,7 +1468,6 @@ base::expected<std::monostate, NullOrIOError> Theme::ApplyStyle(uint32_t resid,
continue;
}
- Theme::Entry new_entry{attr_res_id, it->cookie, (*bag)->type_spec_flags, it->value};
auto entry_it = std::lower_bound(entries_.begin(), entries_.end(), attr_res_id,
ThemeEntryKeyComparer{});
if (entry_it != entries_.end() && entry_it->attr_res_id == attr_res_id) {
@@ -1477,10 +1476,10 @@ base::expected<std::monostate, NullOrIOError> Theme::ApplyStyle(uint32_t resid,
/// true.
entries_.erase(entry_it);
} else if (force) {
- *entry_it = new_entry;
+ *entry_it = Entry{attr_res_id, it->cookie, (*bag)->type_spec_flags, it->value};
}
} else {
- entries_.insert(entry_it, new_entry);
+ entries_.insert(entry_it, Entry{attr_res_id, it->cookie, (*bag)->type_spec_flags, it->value});
}
}
return {};