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

Commit c327d1e6 authored by Sanath Kumar's avatar Sanath Kumar
Browse files

Fix JobScheduler time constraint evaluation delays

Addresses an issue where jobs with time constraints (deadlines and
delays) might not be evaluated correctly in evaluateStateLocked.

The problem stems from the fact that the elapsed time tracking for the
next alarm (used for deadlines/delays) is not reset after an alarm
fires. This can lead to the JobScheduler not re-evaluating jobs that
have reached their deadline or delay, causing them to be delayed or even
missed.

The fix ensures that the elapsed time tracking is properly reset after a
deadline/delay alarm. This allows evaluateStateLocked to accurately
identify and process jobs that have met their time constraints.

Additionally, time-constraint jobs rely on a non-exact alarm timers.
This patch adds an extra check during evaluateStateLocked to detect any
delays in the alarm firing. This will reduce job start latency.

Bug: 400440145
Test: atest --rerun-until-failure 500 CtsJobSchedulerTestCases:android.jobscheduler.cts.TimingConstraintsTest
Test: atest CtsJobSchedulerTestCases
Flag: com.android.server.job.fix_deadline_delay_job_stall

Change-Id: I32e34a1844ad5da4fef0b338aacba0b4ce21d51e
parent ff2a8c13
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment