Commit ae51e2e1 by tonihei Committed by Oliver Woodman

Also fix thread blocking nullness assertion when called from non-Looper

PiperOrigin-RevId: 354268013
parent 60f3d816
......@@ -140,6 +140,11 @@ public class FakeClock implements Clock {
@Override
public synchronized void onThreadBlocked() {
@Nullable Looper currentLooper = Looper.myLooper();
if (currentLooper == null || !waitingForMessage) {
// This isn't a looper message created by this class, so no need to handle the blocking.
return;
}
busyLoopers.add(checkNotNull(Looper.myLooper()));
waitingForMessage = false;
maybeTriggerMessage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment