From 3d13a4f71b75a4b9ab87156613cbd11ebbf9ad94 Mon Sep 17 00:00:00 2001 From: Yurii Zubrytskyi Date: Mon, 5 Aug 2024 11:59:27 -0700 Subject: [res] Make sure cached container is retained off cache The object in the cache may get removed by a different thread, so getting it from the cache needs to also take (shared) ownership instead of relying just on the cache itself. This CL makes the cache hols shared_ptr<> and getting it increments the ref counter, so the object won't go away anymore + fix a few small issues in Idmap - const return types and bad formatting Bug: 332234677 Flag: EXEMPT bugfix Test: build + boot Change-Id: I8e666e380a58b45142ddbd196dd684e5874fd2a6 --- libs/androidfw/Idmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/androidfw/Idmap.cpp') diff --git a/libs/androidfw/Idmap.cpp b/libs/androidfw/Idmap.cpp index 982419059ead..f066e4620675 100644 --- a/libs/androidfw/Idmap.cpp +++ b/libs/androidfw/Idmap.cpp @@ -121,7 +121,7 @@ OverlayDynamicRefTable::OverlayDynamicRefTable(const Idmap_data_header* data_hea uint8_t target_assigned_package_id) : data_header_(data_header), entries_(entries), - target_assigned_package_id_(target_assigned_package_id) { }; + target_assigned_package_id_(target_assigned_package_id) {} status_t OverlayDynamicRefTable::lookupResourceId(uint32_t* resId) const { const Idmap_overlay_entry* first_entry = entries_; -- cgit v1.2.3-59-g8ed1b