Log view root, input and looper state in bug reports.
Bug: 10948648
Change-Id: I956cce2a0fb516c02f9bbbc021f6238bcb226891
diff --git a/core/java/android/os/Looper.java b/core/java/android/os/Looper.java
index 78c859e..21e9f6b 100644
--- a/core/java/android/os/Looper.java
+++ b/core/java/android/os/Looper.java
@@ -59,7 +59,6 @@
final MessageQueue mQueue;
final Thread mThread;
- volatile boolean mRun;
private Printer mLogging;
@@ -187,7 +186,6 @@
private Looper(boolean quitAllowed) {
mQueue = new MessageQueue(quitAllowed);
- mRun = true;
mThread = Thread.currentThread();
}
@@ -300,27 +298,12 @@
}
public void dump(Printer pw, String prefix) {
- pw = PrefixPrinter.create(pw, prefix);
- pw.println(this.toString());
- pw.println("mRun=" + mRun);
- pw.println("mThread=" + mThread);
- pw.println("mQueue=" + ((mQueue != null) ? mQueue : "(null"));
- if (mQueue != null) {
- synchronized (mQueue) {
- long now = SystemClock.uptimeMillis();
- Message msg = mQueue.mMessages;
- int n = 0;
- while (msg != null) {
- pw.println(" Message " + n + ": " + msg.toString(now));
- n++;
- msg = msg.next;
- }
- pw.println("(Total messages: " + n + ")");
- }
- }
+ pw.println(prefix + toString());
+ mQueue.dump(pw, prefix + " ");
}
public String toString() {
- return "Looper{" + Integer.toHexString(System.identityHashCode(this)) + "}";
+ return "Looper (" + mThread.getName() + ", tid " + mThread.getId()
+ + ") {" + Integer.toHexString(System.identityHashCode(this)) + "}";
}
}