summaryrefslogtreecommitdiffstats
path: root/dalvik
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2014-07-18 15:19:22 -0700
committerAlex Light <allight@google.com>2014-08-05 10:22:11 -0700
commit70a89c0f0274ac033785079673ca690ee056eb59 (patch)
tree4d667e29074a6a6362bacaf4bbea80d0c76fc83a /dalvik
parent60b25adc6e4c522097fcd98792bfa23bcc6f8afe (diff)
downloadlibcore-70a89c0f0274ac033785079673ca690ee056eb59.zip
libcore-70a89c0f0274ac033785079673ca690ee056eb59.tar.gz
libcore-70a89c0f0274ac033785079673ca690ee056eb59.tar.bz2
Make system use patchoat to relocate during runtime.
Change DexFile.isDexOptNeededInternal to new signature so that we can determine if we need to run patchoat. Added constants for each of the different outcomes of isDexOptNeededInternal. Bug: 15358152 Change-Id: Ibe92d8b55a24bbf718b0416a21b76e5df7a2de26
Diffstat (limited to 'dalvik')
-rw-r--r--dalvik/src/main/java/dalvik/system/DexFile.java43
1 files changed, 41 insertions, 2 deletions
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index 8c78312..3965b81 100644
--- a/dalvik/src/main/java/dalvik/system/DexFile.java
+++ b/dalvik/src/main/java/dalvik/system/DexFile.java
@@ -309,9 +309,48 @@ public final class DexFile {
throws FileNotFoundException, IOException;
/**
+ * See {@link #isDexOptNeededInternal(String, String, String, boolean)}.
+ *
+ * @hide
+ */
+ public static final byte UP_TO_DATE = 0;
+
+ /**
+ * See {@link #isDexOptNeededInternal(String, String, String, boolean)}.
+ *
+ * @hide
+ */
+ public static final byte PATCHOAT_NEEDED = 1;
+
+ /**
+ * See {@link #isDexOptNeededInternal(String, String, String, boolean)}.
+ *
+ * @hide
+ */
+ public static final byte DEXOPT_NEEDED = 2;
+
+ /**
+ * Returns UP_TO_DATE if the VM believes that the apk/jar file
+ * is up to date, PATCHOAT_NEEDED if it believes that the file is up
+ * to date but it must be relocated to match the base address offset,
+ * and DEXOPT_NEEDED if it believes that it is out of date and should
+ * be passed through "dexopt" again.
+ *
+ * @param fileName the absolute path to the apk/jar file to examine.
+ * @return DEXOPT_NEEDED if dexopt should be called on the file,
+ * PATCHOAT_NEEDED if we need to run "patchoat" on it and
+ * UP_TO_DATE otherwise.
+ * @throws java.io.FileNotFoundException if fileName is not readable,
+ * not a file, or not present.
+ * @throws java.io.IOException if fileName is not a valid apk/jar file or
+ * if problems occur while parsing it.
+ * @throws java.lang.NullPointerException if fileName is null.
+ * @throws dalvik.system.StaleDexCacheError if the optimized dex file
+ * is stale but exists on a read-only partition.
+ *
* @hide
- **/
- public static native boolean isDexOptNeededInternal(String fileName, String pkgname,
+ */
+ public static native byte isDexOptNeededInternal(String fileName, String pkgname,
String instructionSet, boolean defer)
throws FileNotFoundException, IOException;
}