summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-05-16 16:54:16 +0200
committerSebastien Hertz <shertz@google.com>2014-05-28 09:13:45 +0200
commit98d565856280a630bc5c35aaf047fb8d4ad0ddb5 (patch)
tree824df1bf4b40f7d480efd5a34cf00b79ec659d20
parentbbd8e6ffc600e078984cb68acf51c660c5c9fc81 (diff)
downloadframeworks_base-98d565856280a630bc5c35aaf047fb8d4ad0ddb5.zip
frameworks_base-98d565856280a630bc5c35aaf047fb8d4ad0ddb5.tar.gz
frameworks_base-98d565856280a630bc5c35aaf047fb8d4ad0ddb5.tar.bz2
Report runtime information to DDMS
Reports runtime's ABI and internal flags to be displayed by DDMS. Bug: 14888999 Bug: 14888124 (cherry picked from commit e901dbdee242182e4c768edebebc5bc9cbf67563) Change-Id: I248c2558f4a89ebc9bc6b7a4a54db6091d138b33
-rw-r--r--core/java/android/ddm/DdmHandleHello.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/core/java/android/ddm/DdmHandleHello.java b/core/java/android/ddm/DdmHandleHello.java
index 220b40d..2dce425 100644
--- a/core/java/android/ddm/DdmHandleHello.java
+++ b/core/java/android/ddm/DdmHandleHello.java
@@ -22,6 +22,7 @@ import org.apache.harmony.dalvik.ddmc.DdmServer;
import android.util.Log;
import android.os.Debug;
import android.os.UserHandle;
+import dalvik.system.VMRuntime;
import java.nio.ByteBuffer;
@@ -126,8 +127,21 @@ public class DdmHandleHello extends ChunkHandler {
// appName = "unknown";
String appName = DdmHandleAppName.getAppName();
- ByteBuffer out = ByteBuffer.allocate(20
- + vmIdent.length()*2 + appName.length()*2);
+ VMRuntime vmRuntime = VMRuntime.getRuntime();
+ String instructionSetDescription =
+ vmRuntime.is64Bit() ? "64-bit" : "32-bit";
+ String vmInstructionSet = vmRuntime.vmInstructionSet();
+ if (vmInstructionSet != null && vmInstructionSet.length() > 0) {
+ instructionSetDescription += " (" + vmInstructionSet + ")";
+ }
+ String vmFlags = "CheckJNI="
+ + (vmRuntime.isCheckJniEnabled() ? "true" : "false");
+
+ ByteBuffer out = ByteBuffer.allocate(28
+ + vmIdent.length() * 2
+ + appName.length() * 2
+ + instructionSetDescription.length() * 2
+ + vmFlags.length() * 2);
out.order(ChunkHandler.CHUNK_ORDER);
out.putInt(DdmServer.CLIENT_PROTOCOL_VERSION);
out.putInt(android.os.Process.myPid());
@@ -136,6 +150,10 @@ public class DdmHandleHello extends ChunkHandler {
putString(out, vmIdent);
putString(out, appName);
out.putInt(UserHandle.myUserId());
+ out.putInt(instructionSetDescription.length());
+ putString(out, instructionSetDescription);
+ out.putInt(vmFlags.length());
+ putString(out, vmFlags);
Chunk reply = new Chunk(CHUNK_HELO, out);