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

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

Add app-level timeout & ANR limits.

If an app's jobs keep timing out, then the app potentially has a bug.
Timeouts resulted in backoff of the individual job that timed out,
but didn't affect other jobs. This meant that apps could bypass backoff
by scheduling one-off jobs instead of rescheduling using the return
parameter to onStopJob. Now, JobScheduler will track the number of job
timeouts across all of the app's jobs and reduce the app's max job time
if it exceeds a threshold. If the total number of timeouts exceeds
another limit, JobScheduler will consider the app buggy and
attempt to put the app in the RESTRICTED bucket.

Similarly, if an app keeps ANRing from JobScheduler's perspective, it
will consider the app buggy and attempt to put it in the RESTRICTED
bucket.

When an unexempted app is considered buggy, don't treat any of its jobs
as in the ACTIVE unless the app is current active.

Also, reduce the delay for forcing an app in the RESTRICTED bucket
(eg. when the app is buggy) to 1 hour. The normal bucket timeout
continues to be 8 days.

Bug: 284080732
Test: atest AppStandbyControllerTests
Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
Test: atest FrameworksMockingServicesTests:JobStatusTest
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: I8eb333a922658ba6137012dffd7a143cd990376d
parent 09c9df3f
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