Fixing to fail android.JobScheduler.TimingConstraintsTest#testSchedulePeriodic in TV test.

bug id : b/19938983

Change-Id: I7568bb9c41b90a57f2e3b89d3fa694ef692f05ac
diff --git a/services/core/java/com/android/server/job/controllers/TimeController.java b/services/core/java/com/android/server/job/controllers/TimeController.java
index 4c6cb17..b3d7287 100644
--- a/services/core/java/com/android/server/job/controllers/TimeController.java
+++ b/services/core/java/com/android/server/job/controllers/TimeController.java
@@ -91,14 +91,20 @@
     public synchronized void maybeStartTrackingJob(JobStatus job) {
         if (job.hasTimingDelayConstraint() || job.hasDeadlineConstraint()) {
             maybeStopTrackingJob(job);
+            boolean isInsert = false;
             ListIterator<JobStatus> it = mTrackedJobs.listIterator(mTrackedJobs.size());
             while (it.hasPrevious()) {
                 JobStatus ts = it.previous();
                 if (ts.getLatestRunTimeElapsed() < job.getLatestRunTimeElapsed()) {
                     // Insert
+                    isInsert = true;
                     break;
                 }
             }
+            if(isInsert)
+            {
+                it.next();
+            }
             it.add(job);
             maybeUpdateAlarms(
                     job.hasTimingDelayConstraint() ? job.getEarliestRunTime() : Long.MAX_VALUE,