use of org.apache.harmony.dalvik.ddmc.Chunk in project android_frameworks_base by crdroidandroid.
the class DdmHandleViewDebug method dumpTheme.
/**
* Returns the Theme dump of the provided view.
*/
private Chunk dumpTheme(View rootView) {
ByteArrayOutputStream b = new ByteArrayOutputStream(1024);
try {
ViewDebug.dumpTheme(rootView, b);
} catch (IOException e) {
return createFailChunk(1, "Unexpected error while dumping the theme: " + e.getMessage());
}
byte[] data = b.toByteArray();
return new Chunk(CHUNK_VURT, data, 0, data.length);
}
use of org.apache.harmony.dalvik.ddmc.Chunk in project android_frameworks_base by crdroidandroid.
the class DdmHandleViewDebug method captureLayers.
/** Returns a buffer with region details & bitmap of every single view. */
private Chunk captureLayers(View rootView) {
ByteArrayOutputStream b = new ByteArrayOutputStream(1024);
DataOutputStream dos = new DataOutputStream(b);
try {
ViewDebug.captureLayers(rootView, dos);
} catch (IOException e) {
return createFailChunk(1, "Unexpected error while obtaining view hierarchy: " + e.getMessage());
} finally {
try {
dos.close();
} catch (IOException e) {
// ignore
}
}
byte[] data = b.toByteArray();
return new Chunk(CHUNK_VURT, data, 0, data.length);
}
use of org.apache.harmony.dalvik.ddmc.Chunk in project android_frameworks_base by crdroidandroid.
the class DdmHandleViewDebug method listWindows.
/** Returns the list of windows owned by this client. */
private Chunk listWindows() {
String[] windowNames = WindowManagerGlobal.getInstance().getViewRootNames();
// # of windows
int responseLength = 4;
for (String name : windowNames) {
// length of next window name
responseLength += 4;
// window name
responseLength += name.length() * 2;
}
ByteBuffer out = ByteBuffer.allocate(responseLength);
out.order(ChunkHandler.CHUNK_ORDER);
out.putInt(windowNames.length);
for (String name : windowNames) {
out.putInt(name.length());
putString(out, name);
}
return new Chunk(CHUNK_VULW, out);
}
Aggregations