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

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

Let EJs for TOP app run immediately and without limit.

We're encouraging developers to switch from FGS to EJs. However, there
were some aspects of EJs that made developers hesitant to switch over.
This addresses one of the concerns by allowing EJs for the TOP app to
start immediately. "Immediate" here means we start the JobService (call
Context.bindService()) before the call to JobScheduler.schedule()
returns (assuming all of the constraints are met). In order to guarantee
"immediate," we needed to remove the concurrency limit on top-started EJs.
This means there's a chance the TOP app could run more than our intended
limit of 16 apps, so we create new JobServiceContexts for TOP EJs if need
be, and if we ever have more than 16 total jobs running, we don't start
any new jobs (except TOP EJ) until we fall back below the 16 limit. If we
ever get above the intended limit, TOP EJs will be forced to stop at the
earlier timeout (default 3 minutes) instead of being allowed to run for
the full 30 minutes.

Bug: 223437753
Test: atest CtsJobSchedulerTestCases
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Change-Id: I97d19f47533690196619a080087bf0a56a21e8f2
parent c4b98636
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