diff options
| author | 2018-12-13 09:27:04 +0000 | |
|---|---|---|
| committer | 2018-12-13 09:27:04 +0000 | |
| commit | 5d1814e1b36d4ec98cfff78ee8e1824c6dcad818 (patch) | |
| tree | 80b53a8f1cd10ce5cd127b0d0fa5c3f52fb27063 | |
| parent | 0a2a1e0e2d2b9df36ab0f2b65fd536fefe854466 (diff) | |
Use the boot class loader as parent of system server loader.
ART expects the parent of the system server class loader to
be the boot class loader during AOT, so use that at runtime too.
bug: 120039104
Test: boot test
Change-Id: I164f98d319f875d24baa360a4b3d152e8e2fc4d9
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 8bdb000aad0e..c2c6ae6712ab 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -536,9 +536,11 @@ public class ZygoteInit { static ClassLoader createPathClassLoader(String classPath, int targetSdkVersion) { String libraryPath = System.getProperty("java.library.path"); + // We use the boot class loader, that's what the runtime expects at AOT. + ClassLoader parent = ClassLoader.getSystemClassLoader().getParent(); + return ClassLoaderFactory.createClassLoader(classPath, libraryPath, libraryPath, - ClassLoader.getSystemClassLoader(), targetSdkVersion, true /* isNamespaceShared */, - null /* classLoaderName */); + parent, targetSdkVersion, true /* isNamespaceShared */, null /* classLoaderName */); } /** |