summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2014-09-18 12:57:26 -0700
committerJon Miranda <jonmiranda@google.com>2014-09-18 12:57:26 -0700
commit1b786dd50434864944c06313b555fd04669c0ca9 (patch)
tree8a697509a1ab0b5a22015ed654b40e2851fa1fde
parent77c7ab634263481e239c756134843042c6db80fd (diff)
downloadbase-1b786dd50434864944c06313b555fd04669c0ca9.tar.gz
Added support for Theme dumping using DDM.
Change-Id: I6fae97d610a6b2ebb264ab1ff05bb2b6be1366d3
-rw-r--r--ddmlib/src/main/java/com/android/ddmlib/HandleViewDebug.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/ddmlib/src/main/java/com/android/ddmlib/HandleViewDebug.java b/ddmlib/src/main/java/com/android/ddmlib/HandleViewDebug.java
index 83eba76b68..4378350f1f 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/HandleViewDebug.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/HandleViewDebug.java
@@ -40,6 +40,9 @@ public final class HandleViewDebug extends ChunkHandler {
/** Capture View Layers. */
private static final int VURT_CAPTURE_LAYERS = 2;
+ /** Dump View Theme. */
+ private static final int VURT_DUMP_THEME = 3;
+
/**
* Generic View Operation, first parameter in the packet should be one of the
* VUOP_* constants below.
@@ -231,6 +234,23 @@ public final class HandleViewDebug extends ChunkHandler {
sViewOpNullChunkHandler);
}
+ public static void dumpTheme(@NonNull Client client, @NonNull String viewRoot,
+ @NonNull ViewDumpHandler handler)
+ throws IOException {
+ ByteBuffer buf = allocBuffer(4 // opcode
+ + 4 // view root length
+ + viewRoot.length() * 2); // view root
+ JdwpPacket packet = new JdwpPacket(buf);
+ ByteBuffer chunkBuf = getChunkDataBuf(buf);
+
+ chunkBuf.putInt(VURT_DUMP_THEME);
+ chunkBuf.putInt(viewRoot.length());
+ ByteBufferUtil.putString(chunkBuf, viewRoot);
+
+ finishChunkPacket(packet, CHUNK_VURT, chunkBuf.position());
+ client.sendAndConsume(packet, handler);
+ }
+
/** A {@link ViewDumpHandler} to use when no response is expected. */
private static class NullChunkHandler extends ViewDumpHandler {
public NullChunkHandler(int chunkType) {