@Override public synchronized void maybeStartTrackingJob(JobStatus job){
  if (job.hasTimingDelayConstraint() || job.hasDeadlineConstraint()) {
    maybeStopTrackingJob(job);
    ListIterator<JobStatus> it=mTrackedJobs.listIterator(mTrackedJobs.size());
    while (it.hasPrevious()) {
      JobStatus ts=it.previous();
      if (ts.getLatestRunTimeElapsed() < job.getLatestRunTimeElapsed()) {
        break;
      }
    }
    it.add(job);
    maybeUpdateAlarms(job.hasTimingDelayConstraint() ? job.getEarliestRunTime() : Long.MAX_VALUE,job.hasDeadlineConstraint() ? job.getLatestRunTimeElapsed() : Long.MAX_VALUE);
  }
}

@ Override public synchronized void maybeStartTrackingJob ( JobStatus job ) { if ( job . hasTimingDelayConstraint ( ) || job . hasDeadlineConstraint ( ) ) { maybeStopTrackingJob ( job ) ; ListIterator < JobStatus > it = mTrackedJobs . listIterator ( mTrackedJobs . size ( ) ) ; while ( it . hasPrevious ( ) ) { JobStatus ts = it . previous ( ) ; if ( ts . getLatestRunTimeElapsed ( ) < job . getLatestRunTimeElapsed ( ) ) { break ; } } it . add ( job ) ; maybeUpdateAlarms ( job . hasTimingDelayConstraint ( ) ? job . getEarliestRunTime ( ) : Long . MAX_VALUE , job . hasDeadlineConstraint ( ) ? job . getLatestRunTimeElapsed ( ) : Long . MAX_VALUE ) ; } }
check if the job has a timing constraint , and if so determine where to insert it in our list .
