summaryrefslogtreecommitdiffstats
path: root/dalvik
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-08-07 10:05:18 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-07 10:05:18 +0000
commit3628dbf879a4ab1859df04ef7e9c9ce41efd54c4 (patch)
tree0bc792843256b02027735d72f5f57cdfed099342 /dalvik
parent4e38fee5a0bf4f6002c9f0b97173d4c40bbc381b (diff)
parent3a8170efa8fa4ead2dae427294b72b467f92cd50 (diff)
downloadlibcore-3628dbf879a4ab1859df04ef7e9c9ce41efd54c4.zip
libcore-3628dbf879a4ab1859df04ef7e9c9ce41efd54c4.tar.gz
libcore-3628dbf879a4ab1859df04ef7e9c9ce41efd54c4.tar.bz2
am 3a8170ef: Merge "Use absolute path when opening dex files."
* commit '3a8170efa8fa4ead2dae427294b72b467f92cd50': Use absolute path when opening dex files.
Diffstat (limited to 'dalvik')
-rw-r--r--dalvik/src/main/java/dalvik/system/DexFile.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index 3965b81..7aeba87 100644
--- a/dalvik/src/main/java/dalvik/system/DexFile.java
+++ b/dalvik/src/main/java/dalvik/system/DexFile.java
@@ -281,6 +281,18 @@ public final class DexFile {
}
}
+
+ /*
+ * Open a DEX file. The value returned is a magic VM cookie. On
+ * failure, an IOException is thrown.
+ */
+ private static long openDexFile(String sourceName, String outputName, int flags) throws IOException {
+ // Use absolute paths to enable the use of relative paths when testing on host.
+ return openDexFileNative(new File(sourceName).getAbsolutePath(),
+ (outputName == null) ? null : new File(outputName).getAbsolutePath(),
+ flags);
+ }
+
private static native void closeDexFile(long cookie);
private static native Class defineClassNative(String name, ClassLoader loader, long cookie)
throws ClassNotFoundException, NoClassDefFoundError;
@@ -289,7 +301,7 @@ public final class DexFile {
* Open a DEX file. The value returned is a magic VM cookie. On
* failure, an IOException is thrown.
*/
- private static native long openDexFile(String sourceName, String outputName, int flags);
+ private static native long openDexFileNative(String sourceName, String outputName, int flags);
/**
* Returns true if the VM believes that the apk/jar file is out of date