Methods Summary |
---|
public void | connected()Called when the DDM server connects. The handler is allowed to
send messages to the server.
|
public void | disconnected()Called when the DDM server disconnects. Can be used to disable
periodic transmissions or clean up saved state.
|
private native byte[] | getLeakInfo()
|
public org.apache.harmony.dalvik.ddmc.Chunk | handleChunk(org.apache.harmony.dalvik.ddmc.Chunk request)Handle a chunk of data.
Log.i("ddm-nativeheap", "Handling " + name(request.type) + " chunk");
int type = request.type;
if (type == CHUNK_NHGT) {
return handleNHGT(request);
} else {
throw new RuntimeException("Unknown packet "
+ ChunkHandler.name(type));
}
|
private org.apache.harmony.dalvik.ddmc.Chunk | handleNHGT(org.apache.harmony.dalvik.ddmc.Chunk request)
//ByteBuffer in = wrapChunk(request);
byte[] data = getLeakInfo();
if (data != null) {
// wrap & return
Log.i("ddm-nativeheap", "Sending " + data.length + " bytes");
return new Chunk(ChunkHandler.type("NHGT"), data, 0, data.length);
} else {
// failed, return a failure error code and message
return createFailChunk(1, "Something went wrong");
}
|
public static void | register()Register for the messages we're interested in.
DdmServer.registerHandler(CHUNK_NHGT, mInstance);
|