Merge "Introduce BaseDexClassLoader#computeClassLoaderContextsNative" am: f4f5e78d03
Change-Id: Ie491bd4ec82abccd256e9e7a9db2f2d50864db46
diff --git a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
index f5136a4..d0a449b 100644
--- a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
+++ b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
@@ -159,6 +159,20 @@
}
/**
+ * Computes the classloader contexts for each classpath entry in {@code pathList.getDexPaths()}.
+ *
+ * Note that this method is not thread safe, i.e. it is the responsibility of the caller to
+ * ensure that {@code pathList.getDexPaths()} is not modified concurrently with this method
+ * being called.
+ *
+ * @return A non-null array of non-null strings of length
+ * {@code 2 * pathList.getDexPaths().size()}. Every even index (0 is even here) is a dex file
+ * path and every odd entry is the class loader context used to load the previously listed dex
+ * file. E.g. a result might be {@code { "foo.dex", "PCL[]", "bar.dex", "PCL[foo.dex]" } }.
+ */
+ private native String[] computeClassLoaderContextsNative();
+
+ /**
* Constructs an instance.
*
* dexFile must be an in-memory representation of a full dexFile.