From 39cacf2de79e201ac77e7e1100a7b0ba29abb8f5 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Mon, 16 Mar 2020 14:54:02 -0700 Subject: Allow using loaders on non-RM Resources instances Currently there is a limitation where ResourcesLoaders cannot be used on Resources object not created through ResourcesManager. This change creates an update handler for Resources objects that are not registered with ResourcesManager. The handler changes the loaders on the asset manager owned by the Resources instance. Bug: 151666644 Test: atest ResourceLoaderValuesTest Change-Id: I5a89f686386bdb088dc964014e7becc0c2b4770f --- libs/androidfw/ApkAssets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/androidfw/ApkAssets.cpp') diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp index 202651dc86d5..918e7af12d31 100644 --- a/libs/androidfw/ApkAssets.cpp +++ b/libs/androidfw/ApkAssets.cpp @@ -471,7 +471,7 @@ std::unique_ptr ApkAssets::LoadImpl( bool resources_asset_exists = false; auto resources_asset_ = assets->Open(kResourcesArsc, Asset::AccessMode::ACCESS_BUFFER, &resources_asset_exists); - + assets = MultiAssetsProvider::Create(std::move(override_assets), std::move(assets)); // Wrap the handle in a unique_ptr so it gets automatically closed. -- cgit v1.2.3-59-g8ed1b