Try to avoid excessive delays for UI jobs.

Try to avoid "starvation" of background user-initiated jobs by creating
an additional context if they're going to be waiting too long for a new
slot.

Also, enforce that we only ever create one additional slot for a job
type so that we don't keep creating new JobServiceContexts just because
another job became eligible to run before executing jobs finished.

Bug: 248386641
Bug: 261999509
Test: atest FrameworksMockingServicesTests:JobConcurrencyManagerTest
Change-Id: I5d143b14422cec8f98812390bb306acf0026baff
2 files changed