diff options
| author | 2020-11-20 18:49:40 +0000 | |
|---|---|---|
| committer | 2020-11-20 18:52:14 +0000 | |
| commit | 6e258a9c8b55b0a0725d5698df0ea1123f77680b (patch) | |
| tree | 824a84fef031f0aa2d7d390f2f446ba51bc6288e | |
| parent | 0b2d583b45ee80cb4a207276dee0965ef9d98be8 (diff) | |
Clarify why it's safe to add java.library.path to the classloader
namespace.
Test: N/A - comment change only
Change-Id: I9ae485afc4b6b827c09bb7d65c3987eefd433492
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 6a67670d8160..6335baa97e57 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -631,8 +631,11 @@ public class ZygoteInit { /** * Creates a PathClassLoader for the given class path that is associated with a shared - * namespace, i.e., this classloader can access platform-private native libraries. The - * classloader will use java.library.path as the native library path. + * namespace, i.e., this classloader can access platform-private native libraries. + * + * The classloader will add java.library.path to the native library path for the classloader + * namespace. Since it includes platform locations like /system/lib, this is only appropriate + * for platform code that don't need linker namespace isolation (as opposed to APEXes and apps). */ static ClassLoader createPathClassLoader(String classPath, int targetSdkVersion) { String libraryPath = System.getProperty("java.library.path"); |