Pass the Java caller's location to OpenNativeLibrary.
Will be used to find the linker namespace to use.
Bug: 122874359
Test: m, gtest, run-test, CtsJdwpTests
Change-Id: I3f3be4a1d864741d585ab3ed9ffb93fab262516e
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index af7df72..0a808ce 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -624,10 +624,11 @@
}
void* OpenNativeLibrary(JNIEnv* env, int32_t target_sdk_version, const char* path,
- jobject class_loader, jstring library_path, bool* needs_native_bridge,
- char** error_msg) {
+ jobject class_loader, const char* caller_location, jstring library_path,
+ bool* needs_native_bridge, char** error_msg) {
#if defined(__ANDROID__)
UNUSED(target_sdk_version);
+ UNUSED(caller_location);
if (class_loader == nullptr) {
*needs_native_bridge = false;
void* handle = dlopen(path, RTLD_NOW);
@@ -654,7 +655,7 @@
return OpenNativeLibraryInNamespace(ns, path, needs_native_bridge, error_msg);
#else
- UNUSED(env, target_sdk_version, class_loader);
+ UNUSED(env, target_sdk_version, class_loader, caller_location);
// Do some best effort to emulate library-path support. It will not
// work for dependencies.