Skip to content
Commit bb5e3b5f authored by Kweku Adams's avatar Kweku Adams
Browse files

Reducing overhead of job constraint evaluation.

1. TimeController was checking its expired deadline and delay jobs even
when the job in question already had its constraint satisfied.
2. In the worst case, TimeController.evaluateStateLocked would check all
N jobs even though the job in question is the only one that matters in
that case. Adding the wouldBeReadyWithConstraint check in
evaluateStateLocked reduces worst case runtime by a factor of N.
3. With the introduction of job alarm skipping, TimeController would
sometimes schedule an alarm with AlarmManager for the exact same time it
had the alarm set for. Adding a check removes that unnecessary call.

Bug: 123756120
Bug: 123879683
Test: atest com.android.server.job.controllers.JobStatusTest
Test: atest com.android.server.job.controllers.TimeControllerTest
Test: atest FrameworksMockingServicesTests
Test: atest JobThrottlingTest
Test: atest TimingConstraintsTest
Change-Id: Iedf7873398a6938f6dd4fed5e92ee2e8d2c211bb
parent fce528d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment