Skip to content
Snippets Groups Projects
Forked from Dhina17 / platform_frameworks_base
Source project has a limited visibility.
user avatar
Kweku Adams authored
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
a57583df
History
Name Last commit Last update