Ignore target sdk version for the public namespace

This fixes the bug with using the libraries loaded
prior to android_set_target_sdk_version call.

Bug: http://b/22548808
Change-Id: I3ca2d367b0fa930a437bbb65f780834803d2ef0a
This commit is contained in:
Dmitriy Ivanov
2015-11-17 18:36:50 -08:00
parent b804b9d67b
commit 3cc35e224c
2 changed files with 9 additions and 2 deletions

View File

@@ -2255,9 +2255,12 @@ bool init_public_namespace(const char* libs) {
g_public_namespace.clear();
});
soinfo* candidate;
for (const auto& soname : sonames) {
if (!find_loaded_library_by_soname(&g_default_namespace, soname.c_str(), &candidate)) {
soinfo* candidate = nullptr;
find_loaded_library_by_soname(&g_default_namespace, soname.c_str(), &candidate);
if (candidate == nullptr) {
DL_ERR("Error initializing public namespace: \"%s\" was not found"
" in the default namespace", soname.c_str());
return false;