private void maybeRunPendingJobsH(){
synchronized (mJobs) {
    Iterator<JobStatus> it=mPendingJobs.iterator();
    if (DEBUG) {
    }
    while (it.hasNext()) {
      JobStatus nextPending=it.next();
      JobServiceContext availableContext=null;
      for (int i=0; i < mActiveServices.size(); i++) {
        JobServiceContext jsc=mActiveServices.get(i);
        final JobStatus running=jsc.getRunningJob();
        if (running != null && running.matches(nextPending.getUid(),nextPending.getJobId())) {
          availableContext=null;
          break;
        }
        if (jsc.isAvailable()) {
          availableContext=jsc;
        }
      }
      if (availableContext != null) {
        if (!availableContext.executeRunnableJob(nextPending)) {
          if (DEBUG) {
          }
          mJobs.remove(nextPending);
        }
        it.remove();
      }
    }
  }
}

private void maybeRunPendingJobsH ( ) { synchronized ( mJobs ) { Iterator < JobStatus > it = mPendingJobs . iterator ( ) ; if ( DEBUG ) { } while ( it . hasNext ( ) ) { JobStatus nextPending = it . next ( ) ; JobServiceContext availableContext = null ; for ( int i = 0 ; i < mActiveServices . size ( ) ; i ++ ) { JobServiceContext jsc = mActiveServices . get ( i ) ; final JobStatus running = jsc . getRunningJob ( ) ; if ( running != null && running . matches ( nextPending . getUid ( ) , nextPending . getJobId ( ) ) ) { availableContext = null ; break ; } if ( jsc . isAvailable ( ) ) { availableContext = jsc ; } } if ( availableContext != null ) { if ( ! availableContext . executeRunnableJob ( nextPending ) ) { if ( DEBUG ) { } mJobs . remove ( nextPending ) ; } it . remove ( ) ; } } } }
reconcile jobs in the pending queue against available execution contexts . a controller can force a job into the pending queue even if it ' s already running , but here is where we decide whether to actually execute it .
