summaryrefslogtreecommitdiff
path: root/libs/androidfw/ResourceUtils.cpp
diff options
context:
space:
mode:
author Ryan Mitchell <rtmitchell@google.com> 2019-01-23 16:56:51 -0800
committer Ryan Mitchell <rtmitchell@google.com> 2019-01-24 15:45:43 -0800
commit741e96ff07326292744ee5bc437ba7171f7c3f56 (patch)
tree9c4514cb534fd315b5327cb34e86e3407a9df435 /libs/androidfw/ResourceUtils.cpp
parent9ce77e9b7f0a1d001428030f3ad738220378ae40 (diff)
Fix GetResourceName for shared libraries
GetResourceName used GetPAckageById which only works when the compile time package id is eqal to the runtime package id. This change resolves resource names correctly using the ruuntime package id. Bug: 79666085 Test: libandroidfw_tests Change-Id: Ic60cb2416329c5cb34e925991cd689ca7574b483
Diffstat (limited to 'libs/androidfw/ResourceUtils.cpp')
-rw-r--r--libs/androidfw/ResourceUtils.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/androidfw/ResourceUtils.cpp b/libs/androidfw/ResourceUtils.cpp
index 645984d85c34..c63dff8f9104 100644
--- a/libs/androidfw/ResourceUtils.cpp
+++ b/libs/androidfw/ResourceUtils.cpp
@@ -48,12 +48,12 @@ bool ExtractResourceName(const StringPiece& str, StringPiece* out_package, Strin
!(has_type_separator && out_type->empty());
}
-bool ToResourceName(StringPoolRef& type_string_ref,
- StringPoolRef& entry_string_ref,
- const LoadedPackage* package,
+bool ToResourceName(const StringPoolRef& type_string_ref,
+ const StringPoolRef& entry_string_ref,
+ const StringPiece& package_name,
AssetManager2::ResourceName* out_name) {
- out_name->package = package->GetPackageName().data();
- out_name->package_len = package->GetPackageName().size();
+ out_name->package = package_name.data();
+ out_name->package_len = package_name.size();
out_name->type = type_string_ref.string8(&out_name->type_len);
out_name->type16 = nullptr;