diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp index 8c2a632b9fd7d..a545b3d5e1341 100644 --- a/libs/androidfw/AssetManager2.cpp +++ b/libs/androidfw/AssetManager2.cpp @@ -1041,7 +1041,9 @@ base::expected AssetManager2::ResolveBag( base::expected AssetManager2::GetBag(uint32_t resid) const { std::vector found_resids; - return GetBag(resid, found_resids); + const auto bag = GetBag(resid, found_resids); + cached_bag_resid_stacks_.emplace(resid, found_resids); + return bag; } base::expected AssetManager2::GetBag(