Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df58a1bb authored by Simon Wilson's avatar Simon Wilson Committed by Android Git Automerger
Browse files

am 3d79f1ce: am edc68a00: Merge "Attempt to reduce problems from issue #3183612" into gingerbread

* commit '3d79f1ce':
  Attempt to reduce problems from issue #3183612
parents 093430fd 3d79f1ce
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -112,6 +112,12 @@ public class Looper {
            throw new RuntimeException("No Looper; Looper.prepare() wasn't called on this thread.");
        }
        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 (msg != null) {
@@ -127,6 +133,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();
            }
        }