Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4c0545e authored by Christopher Tate's avatar Christopher Tate
Browse files

Remember to prepare() jobs when synthesizing them

Fixes: 117994306
Test: manual (boot with forced incorrect time & persisted jobs)
Change-Id: Ib8450373b4d484c4f8fda510035d5784d9b0d285
parent 707b4655
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ public final class JobStore {
    public void getRtcCorrectedJobsLocked(final ArrayList<JobStatus> toAdd,
            final ArrayList<JobStatus> toRemove) {
        final long elapsedNow = sElapsedRealtimeClock.millis();
        final IActivityManager am = ActivityManager.getService();

        // Find the jobs that need to be fixed up, collecting them for post-iteration
        // replacement with their new versions
@@ -182,9 +183,11 @@ public final class JobStore {
            if (utcTimes != null) {
                Pair<Long, Long> elapsedRuntimes =
                        convertRtcBoundsToElapsed(utcTimes, elapsedNow);
                toAdd.add(new JobStatus(job, job.getBaseHeartbeat(),
                JobStatus newJob = new JobStatus(job, job.getBaseHeartbeat(),
                        elapsedRuntimes.first, elapsedRuntimes.second,
                        0, job.getLastSuccessfulRunTime(), job.getLastFailedRunTime()));
                        0, job.getLastSuccessfulRunTime(), job.getLastFailedRunTime());
                newJob.prepareLocked(am);
                toAdd.add(newJob);
                toRemove.add(job);
            }
        });