Also fix thread blocking nullness assertion when called from non-Looper
PiperOrigin-RevId: 354268013
This commit is contained in:
parent
60f3d8168c
commit
ae51e2e1d1
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user