Loading core/java/android/os/Looper.java +18 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.os; import android.util.Config; import android.util.Log; import android.util.Printer; /** Loading Loading @@ -106,6 +107,12 @@ public class Looper { public static final void loop() { Looper me = myLooper(); MessageQueue queue = me.mQueue; // Make sure the identity of this thread is that of the local process, // and keep track of what that identity token actually is. Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); while (true) { Message msg = queue.next(); // might block //if (!me.mRun) { Loading @@ -124,6 +131,17 @@ public class Looper { if (me.mLogging!= null) me.mLogging.println( "<<<<< Finished to " + msg.target + " " + msg.callback); // Make sure that during the course of dispatching the // identity of the thread wasn't corrupted. final long newIdent = Binder.clearCallingIdentity(); if (ident != newIdent) { Log.wtf("Looper", "Thread identity changed from 0x" + Long.toHexString(ident) + " to 0x" + Long.toHexString(newIdent) + " while dispatching to " + msg.target + " " + msg.callback + " what=" + msg.what); } msg.recycle(); } } Loading Loading
core/java/android/os/Looper.java +18 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.os; import android.util.Config; import android.util.Log; import android.util.Printer; /** Loading Loading @@ -106,6 +107,12 @@ public class Looper { public static final void loop() { Looper me = myLooper(); MessageQueue queue = me.mQueue; // Make sure the identity of this thread is that of the local process, // and keep track of what that identity token actually is. Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); while (true) { Message msg = queue.next(); // might block //if (!me.mRun) { Loading @@ -124,6 +131,17 @@ public class Looper { if (me.mLogging!= null) me.mLogging.println( "<<<<< Finished to " + msg.target + " " + msg.callback); // Make sure that during the course of dispatching the // identity of the thread wasn't corrupted. final long newIdent = Binder.clearCallingIdentity(); if (ident != newIdent) { Log.wtf("Looper", "Thread identity changed from 0x" + Long.toHexString(ident) + " to 0x" + Long.toHexString(newIdent) + " while dispatching to " + msg.target + " " + msg.callback + " what=" + msg.what); } msg.recycle(); } } Loading