diff options
author | Elliott Hughes <enh@google.com> | 2012-12-20 14:33:22 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2012-12-21 14:39:02 -0800 |
commit | 652abda3efa231d431375677363f4a36327eeda7 (patch) | |
tree | ee44085b088410ee8a11c6826e8e854b889a22ff /dalvik | |
parent | e60dbb8a86df42576659c0be0591a2f072074bc8 (diff) | |
download | libcore-652abda3efa231d431375677363f4a36327eeda7.zip libcore-652abda3efa231d431375677363f4a36327eeda7.tar.gz libcore-652abda3efa231d431375677363f4a36327eeda7.tar.bz2 |
Support System.loadLibrary for libraries with transitive dependencies.
Bug: 7896159
Bug: http://code.google.com/p/android/issues/detail?id=34416
Change-Id: Id1225a353b52c50bb3eedfd48e92ec85dd60134b
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java | 14 | ||||
-rw-r--r-- | dalvik/src/main/java/dalvik/system/DexPathList.java | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java index 1c006ba..6d5ae1a 100644 --- a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java +++ b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java @@ -112,6 +112,20 @@ public class BaseDexClassLoader extends ClassLoader { return null; } + /** + * @hide + */ + public String getLdLibraryPath() { + StringBuilder result = new StringBuilder(); + for (File directory : path.getNativeLibraryDirectories()) { + if (result.length() > 0) { + result.append(':'); + } + result.append(directory); + } + return result.toString(); + } + @Override public String toString() { return getClass().getName() + "[" + path + "]"; } diff --git a/dalvik/src/main/java/dalvik/system/DexPathList.java b/dalvik/src/main/java/dalvik/system/DexPathList.java index 1ae48d9..3088ca5 100644 --- a/dalvik/src/main/java/dalvik/system/DexPathList.java +++ b/dalvik/src/main/java/dalvik/system/DexPathList.java @@ -109,6 +109,13 @@ import static libcore.io.OsConstants.*; } /** + * For BaseDexClassLoader.getLdLibraryPath. + */ + public File[] getNativeLibraryDirectories() { + return nativeLibraryDirectories; + } + + /** * Splits the given dex path string into elements using the path * separator, pruning out any elements that do not refer to existing * and readable files. (That is, directories are not included in the |