summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-01-11 15:58:08 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2019-01-15 18:21:42 +0000
commit42b30e7a2fba04365700b1b69aa149ec48dff29f (patch)
treed827efe5970ce9e46d9e55f35017445374934365
parent2499cc2f97eeeddd150d756ad5547644f3694978 (diff)
Move to C API of libnativeloader.
Test: m Bug: 119840313 Change-Id: Ia2ba3e4ed69d35310838ed57e03dfc122c3579db
-rw-r--r--core/jni/android_app_NativeActivity.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp
index 49a24a30f77e..b2d3651079e1 100644
--- a/core/jni/android_app_NativeActivity.cpp
+++ b/core/jni/android_app_NativeActivity.cpp
@@ -281,15 +281,18 @@ loadNativeCode_native(JNIEnv* env, jobject clazz, jstring path, jstring funcName
std::unique_ptr<NativeCode> code;
bool needs_native_bridge = false;
+ char* nativeloader_error_msg = nullptr;
void* handle = OpenNativeLibrary(env,
sdkVersion,
pathStr.c_str(),
classLoader,
libraryPath,
&needs_native_bridge,
- &g_error_msg);
+ &nativeloader_error_msg);
if (handle == nullptr) {
+ g_error_msg = nativeloader_error_msg;
+ NativeLoaderFreeErrorMessage(nativeloader_error_msg);
ALOGW("NativeActivity LoadNativeLibrary(\"%s\") failed: %s",
pathStr.c_str(),
g_error_msg.c_str());