From aa9843198dec910a581bdc509d3937a9ea6ceca9 Mon Sep 17 00:00:00 2001 From: Matthew Williams Date: Thu, 15 Oct 2015 16:08:05 -0700 Subject: [PATCH] Change scheduling logic to run network jobs sooner BUG: 24385082 BUG: 23144425 BUG: 18117279 Run jobs with connectivity constraints as soon as the developer-allotted delay has expired, rather than waiting for the override deadline. This is more in tune with what developers expect, although it reduces the amount of batching the scheduler can theoretically do. This will also have the side effect of fixing several failing cts tests that started breaking b/c the signal to 'run connectivity jobs early' was removed in M and nothing was put in to replace it. Change-Id: I7e63c2b62f2882ee906f748445bbf10c32e19c5f --- .../core/java/com/android/server/job/JobSchedulerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/job/JobSchedulerService.java b/services/core/java/com/android/server/job/JobSchedulerService.java index 06bd583fc7b35..3c50102157f12 100644 --- a/services/core/java/com/android/server/job/JobSchedulerService.java +++ b/services/core/java/com/android/server/job/JobSchedulerService.java @@ -73,7 +73,7 @@ import com.android.server.job.controllers.TimeController; */ public class JobSchedulerService extends com.android.server.SystemService implements StateChangedListener, JobCompletedListener { - static final boolean DEBUG = false; + public static final boolean DEBUG = false; /** The number of concurrent jobs we run at one time. */ private static final int MAX_JOB_CONTEXTS_COUNT = ActivityManager.isLowRamDeviceStatic() ? 1 : 3; @@ -99,7 +99,7 @@ public class JobSchedulerService extends com.android.server.SystemService * Minimum # of connectivity jobs that must be ready in order to force the JMS to schedule * things early. */ - static final int MIN_CONNECTIVITY_COUNT = 2; + static final int MIN_CONNECTIVITY_COUNT = 1; // Run connectivity jobs as soon as ready. /** * Minimum # of jobs (with no particular constraints) for which the JMS will be happy running * some work early.