diff options
author | Calin Juravle <calin@google.com> | 2020-03-26 15:38:27 -0700 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2020-03-27 12:39:06 -0700 |
commit | 6a43826f35e1c58f55950312600a8f25cd7aabcf (patch) | |
tree | bc1395b787500b03a0300b5cd66af02e6dc4381c /dalvik | |
parent | 2ab7ac169c53576a2d4df41e0ed85f8d65b41511 (diff) |
Open access to reportClassLoaderChain as CorePlatformAPI
This is needed to support system server classpath reporting.
SystemServer class loader is constructed before we can install
a reporter. As such, we need a way to report the existing classpath
after the class loader is constructed.
Test: m
Bug: 148774920
Change-Id: Ice170bfd093ece643425695e2afbd6f2af675614
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java index 4a9e863118..ee20d802a0 100644 --- a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java +++ b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java @@ -128,15 +128,20 @@ public class BaseDexClassLoader extends ClassLoader { : Arrays.copyOf(sharedLibraryLoaders, sharedLibraryLoaders.length); this.pathList = new DexPathList(this, dexPath, librarySearchPath, null, isTrusted); - if (reporter != null) { - reportClassLoaderChain(); - } + reportClassLoaderChain(); } /** * Reports the current class loader chain to the registered {@code reporter}. + * + * @hide */ - private void reportClassLoaderChain() { + @libcore.api.CorePlatformApi + public void reportClassLoaderChain() { + if (reporter == null) { + return; + } + String[] classPathAndClassLoaderContexts = computeClassLoaderContextsNative(); if (classPathAndClassLoaderContexts.length == 0) { return; @@ -367,7 +372,7 @@ public class BaseDexClassLoader extends ClassLoader { /** * Reports the construction of a BaseDexClassLoader and provides opaque information about * the class loader chain. For example, if the childmost ClassLoader in the chain: - * {@quote BaseDexClassLoader { foo.dex } -> BaseDexClassLoader { base.apk } + * {@quote BaseDexClassLoader { foo.dex } -> BaseDexClassLoader { base.apk } * -> BootClassLoader } was just initialized then the load of {@code "foo.dex"} would be * reported with a classLoaderContext of {@code "PCL[];PCL[base.apk]"}. * |