shadows/framework/src/main/java/org/robolectric/shadows/ShadowPausedMessageQueue.java
@Implementation(minSdk = 23)
  public boolean isIdle() {
    if (Build.VERSION.SDK_INT >= M) {
      return directlyOn(realQueue, MessageQueue.class).isIdle();
    } else {
      ReflectorMessageQueue internalQueue = reflector(ReflectorMessageQueue.class, realQueue);
      // this is a copy of the implementation from P
      synchronized (realQueue) {
        final long now = SystemClock.uptimeMillis();
        Message headMsg = internalQueue.getMessages();
        if (headMsg == null) {
          return true;
        }
        long when = shadowOfMsg(headMsg).getWhen();
        return now < when;
      }
    }
  }
@Implementation(minSdk = 23)
  public boolean isIdle() {
    if (Build.VERSION.SDK_INT >= M) {
      return directlyOn(realQueue, MessageQueue.class).isIdle();
    } else {
      ReflectorMessageQueue internalQueue = reflector(ReflectorMessageQueue.class, realQueue);
      // this is a copy of the implementation from P
      synchronized (realQueue) {
        final long now = SystemClock.uptimeMillis();
        Message headMsg = internalQueue.getMessages();
        if (headMsg == null) {
          return true;
        }
        long when = shadowOfMsg(headMsg).getWhen();
        return now < when;
      }
    }
  }
@ Implementation ( minSdk = 23 ) public boolean isIdle ( ) { if ( Build . VERSION . SDK_INT >= M ) { return directlyOn ( realQueue , MessageQueue . class ) . isIdle ( ) ; } else { ReflectorMessageQueue internalQueue = reflector ( ReflectorMessageQueue . class , realQueue ) ; // this is a copy of the implementation from P synchronized ( realQueue ) { final long now = SystemClock . uptimeMillis ( ) ; Message headMsg = internalQueue . getMessages ( ) ; if ( headMsg == null ) { return true ; } long when = shadowOfMsg ( headMsg ) . getWhen ( ) ; return now < when ; } } }
Exposes the API23+_isIdle method to older platforms
Exposes the API23 + _isIdle method to older platforms