diff options
author | Elliott Hughes <enh@google.com> | 2014-04-03 22:55:03 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-03 22:55:04 +0000 |
commit | df945d726e02034dafdcf7469f71865b86dc3e9d (patch) | |
tree | ce73112c2641ea3c28e34a886e1795d7ac3016a1 /luni/src/main | |
parent | e471f800ea4b4a8549ac2d4979261a499fc0d81e (diff) | |
parent | 1bc030b6c8a52e1911efcd58d6fbc7f982649167 (diff) | |
download | libcore-df945d726e02034dafdcf7469f71865b86dc3e9d.zip libcore-df945d726e02034dafdcf7469f71865b86dc3e9d.tar.gz libcore-df945d726e02034dafdcf7469f71865b86dc3e9d.tar.bz2 |
Merge "Finish moving away from LD_LIBRARY_PATH on Android."
Diffstat (limited to 'luni/src/main')
-rw-r--r-- | luni/src/main/java/java/lang/System.java | 5 | ||||
-rw-r--r-- | luni/src/main/native/java_lang_System.cpp | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/luni/src/main/java/java/lang/System.java b/luni/src/main/java/java/lang/System.java index 7cf3993..3f72c95 100644 --- a/luni/src/main/java/java/lang/System.java +++ b/luni/src/main/java/java/lang/System.java @@ -356,11 +356,6 @@ public final class System { } p.put("java.home", javaHome); - String ldLibraryPath = getenv("LD_LIBRARY_PATH"); - if (ldLibraryPath != null) { - p.put("java.library.path", ldLibraryPath); - } - p.put("java.specification.name", "Dalvik Core Library"); p.put("java.specification.vendor", projectName); p.put("java.specification.version", "0.9"); diff --git a/luni/src/main/native/java_lang_System.cpp b/luni/src/main/native/java_lang_System.cpp index f8b98b1..944c0c3 100644 --- a/luni/src/main/native/java_lang_System.cpp +++ b/luni/src/main/native/java_lang_System.cpp @@ -34,6 +34,10 @@ #include <time.h> #include <unistd.h> +#if defined(HAVE_ANDROID_OS) +extern "C" void android_get_LD_LIBRARY_PATH(char*, size_t); +#endif + static void System_log(JNIEnv* env, jclass, jchar type, jstring javaMessage, jthrowable exception) { ScopedUtfChars message(env, javaMessage); if (message.c_str() == NULL) { @@ -82,6 +86,18 @@ static jobjectArray System_specialProperties(JNIEnv* env, jclass) { properties.push_back("android.zlib.version=" ZLIB_VERSION); properties.push_back("android.openssl.version=" OPENSSL_VERSION_TEXT); + const char* library_path = getenv("LD_LIBRARY_PATH"); +#if defined(HAVE_ANDROID_OS) + if (library_path == NULL) { + android_get_LD_LIBRARY_PATH(path, sizeof(path)); + library_path = path; + } +#endif + if (library_path == NULL) { + library_path = ""; + } + properties.push_back(std::string("java.library.path=") + library_path); + return toStringArray(env, properties); } |