diff options
| author | Victor Chang <vichang@google.com> | 2019-02-07 15:20:25 +0000 |
|---|---|---|
| committer | Victor Chang <vichang@google.com> | 2019-02-12 14:53:01 +0000 |
| commit | a366cc8c527291b8bea293f07f727496c855c90a (patch) | |
| tree | 5eae02a2f2dd4543f14d648ba16fa3e3f7604411 /core/java/android/app/LoadedApk.java | |
| parent | 1fe970651fbe535317e5efd8d9e40313b1ac0660 (diff) | |
Include /apex/com.android.runtime for native library in app classloader
Bug: 123702996
Test: Manual test. After moving libicuuc.so into the apex path,
call System.loadLibrary("icuuc") in test app
Test: CtsJniTestCases pass after moving libicuuc into apex and applied
CTS patch here. http://r.android.com/898053
Change-Id: Ic9049c1595b4ea029ec65649c3f3283672744569
Diffstat (limited to 'core/java/android/app/LoadedApk.java')
| -rw-r--r-- | core/java/android/app/LoadedApk.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java index 0d3110cfded8..ac33c169288b 100644 --- a/core/java/android/app/LoadedApk.java +++ b/core/java/android/app/LoadedApk.java @@ -850,8 +850,9 @@ public final class LoadedApk { } } - // /vendor/lib, /odm/lib and /product/lib are added to the native lib search - // paths of the classloader. Note that this is done AFTER the classloader is + // /aepx/com.android.runtime/lib, /vendor/lib, /odm/lib and /product/lib + // are added to the native lib search paths of the classloader. + // Note that this is done AFTER the classloader is // created by ApplicationLoaders.getDefault().getClassLoader(...). The // reason is because if we have added the paths when creating the classloader // above, the paths are also added to the search path of the linker namespace @@ -868,8 +869,11 @@ public final class LoadedApk { // System.loadLibrary(). In order to prevent the problem, we explicitly // add the paths only to the classloader, and not to the native loader // (linker namespace). - List<String> extraLibPaths = new ArrayList<>(3); + List<String> extraLibPaths = new ArrayList<>(4); String abiSuffix = VMRuntime.getRuntime().is64Bit() ? "64" : ""; + if (!defaultSearchPaths.contains("/apex/com.android.runtime/lib")) { + extraLibPaths.add("/apex/com.android.runtime/lib" + abiSuffix); + } if (!defaultSearchPaths.contains("/vendor/lib")) { extraLibPaths.add("/vendor/lib" + abiSuffix); } |
