private void runPendingRequests(){
  int maxStartId=-1;
  BillingRequest request;
  while ((request=mPendingRequests.peek()) != null) {
    if (request.runIfConnected()) {
      mPendingRequests.remove();
      if (maxStartId < request.getStartId()) {
        maxStartId=request.getStartId();
      }
    }
 else {
      bindToMarketBillingService();
      return;
    }
  }
  if (maxStartId >= 0) {
    if (Consts.DEBUG) {
      Log.i(TAG,"stopping service, startId: " + maxStartId);
    }
    stopSelf(maxStartId);
  }
}

private void runPendingRequests ( ) { int maxStartId = - 1 ; BillingRequest request ; while ( ( request = mPendingRequests . peek ( ) ) != null ) { if ( request . runIfConnected ( ) ) { mPendingRequests . remove ( ) ; if ( maxStartId < request . getStartId ( ) ) { maxStartId = request . getStartId ( ) ; } } else { bindToMarketBillingService ( ) ; return ; } } if ( maxStartId >= 0 ) { if ( Consts . DEBUG ) { Log . i ( TAG , "stopping service, startId: " + maxStartId ) ; } stopSelf ( maxStartId ) ; } }
runs any pending requests that are waiting for a connection to the service to be established . this runs in the main ui thread .
