diff options
author | 2024-08-05 11:59:27 -0700 | |
---|---|---|
committer | 2024-08-05 13:10:47 -0700 | |
commit | 3d13a4f71b75a4b9ab87156613cbd11ebbf9ad94 (patch) | |
tree | e01f71b841d63769cb86ca4cf72f176db60b986c /libs/androidfw/Idmap.cpp | |
parent | 04f157c77b8adfc854135b9e788d9f75e1d3b87b (diff) |
[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
Diffstat (limited to 'libs/androidfw/Idmap.cpp')
-rw-r--r-- | libs/androidfw/Idmap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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_; |