From 451d99525dc8fef247e6fe6f4c714cbdf7f8b322 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Fri, 16 May 2014 16:35:09 +0200 Subject: Provide more information about the runtime Adds methods vmInstructionSet, is64Bit and isCheckJniEnabled to the VMRuntime class. They are used by DdmHandleHello class in the framework to report new information about the runtime to DDMS. Bug: 14888999 Bug: 14888124 Change-Id: I8a2d3f22f84a093be2fbc74464af6aa7b2a2bebb --- libart/src/main/java/dalvik/system/VMRuntime.java | 15 +++++++++++++ libdvm/src/main/java/dalvik/system/VMRuntime.java | 26 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/libart/src/main/java/dalvik/system/VMRuntime.java b/libart/src/main/java/dalvik/system/VMRuntime.java index ae65950..48b2dfa 100644 --- a/libart/src/main/java/dalvik/system/VMRuntime.java +++ b/libart/src/main/java/dalvik/system/VMRuntime.java @@ -89,6 +89,21 @@ public final class VMRuntime { public native String vmLibrary(); /** + * Returns the VM's instruction set. + */ + public native String vmInstructionSet(); + + /** + * Returns whether the VM is running in 64-bit mode. + */ + public native boolean is64Bit(); + + /** + * Returns whether the VM is running with JNI checking enabled. + */ + public native boolean isCheckJniEnabled(); + + /** * Gets the current ideal heap utilization, represented as a number * between zero and one. After a GC happens, the Dalvik heap may * be resized so that (size of live objects) / (size of heap) is diff --git a/libdvm/src/main/java/dalvik/system/VMRuntime.java b/libdvm/src/main/java/dalvik/system/VMRuntime.java index d532210..0b0fdc2 100644 --- a/libdvm/src/main/java/dalvik/system/VMRuntime.java +++ b/libdvm/src/main/java/dalvik/system/VMRuntime.java @@ -87,6 +87,32 @@ public final class VMRuntime { public native String vmLibrary(); /** + * Returns the VM's instruction set. + */ + public String vmInstructionSet() { + return ""; + } + + /** + * Returns the VM's internal flags. + */ + public String vmFlags() { + return ""; + } + + /** + * Returns whether the VM is running in 64-bit mode. + */ + public boolean is64Bit() { + return false; + } + + /** + * Returns whether the VM is running with JNI checking enabled. + */ + public native boolean isCheckJniEnabled(); + + /** * Gets the current ideal heap utilization, represented as a number * between zero and one. After a GC happens, the Dalvik heap may * be resized so that (size of live objects) / (size of heap) is -- cgit v1.1