DumpUtils.javaAPI DocAndroid 5.1 API1795Thu Mar 12 22:22:10 GMT


public final class DumpUtils extends Object
Helper functions for dumping the state of system services.

Fields Summary
Constructors Summary
private DumpUtils()

Methods Summary
public static voiddumpAsync(android.os.Handler handler,$Dump dump, pw, long timeout)
Helper for dumping state owned by a handler thread. Because the caller might be holding an important lock that the handler is trying to acquire, we use a short timeout to avoid deadlocks. The process is inelegant but this function is only used for debugging purposes.

        final StringWriter sw = new StringWriter();
        if (handler.runWithScissors(new Runnable() {
            public void run() {
                PrintWriter lpw = new FastPrintWriter(sw);
        }, timeout)) {
        } else {
            pw.println("... timed out");