summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-08-12 11:36:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-11 18:41:55 +0000
commitf169bde56ce49b4d2ea527be99644480d5026f78 (patch)
treec61020ad6d8cb1ded94454da8fb54f6835d2f837
parent8fc0cb95f87a8a31c56793a3d24e58bcc5d88025 (diff)
parent813579d06877fed67c2c62054213d8efcff6d37b (diff)
downloadlibcore-f169bde56ce49b4d2ea527be99644480d5026f78.zip
libcore-f169bde56ce49b4d2ea527be99644480d5026f78.tar.gz
libcore-f169bde56ce49b4d2ea527be99644480d5026f78.tar.bz2
Merge "Use absolute path when opening dex files." into lmp-dev
-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