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

Commit b98a8719 authored by Kweku Adams's avatar Kweku Adams
Browse files

Fix logging.

Exclude the unbatched count from the logged value to get an accurate
number of jobs that are piggybacking on something else.

Bug: 28382445
Test: atest CtsJobSchedulerTestCases
Change-Id: Id6db3a40287db53e13f5f195d1688c34681350c4
parent 5831e0f8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3852,7 +3852,7 @@ public class JobSchedulerService extends com.android.server.SystemService
                    // the other jobs that will use this network.
                    if (DEBUG) {
                        Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: piggybacking "
                                + batchedJobs.size() + " jobs on " + network
                                + (batchedJobs.size() - unbatchedJobCount) + " jobs on " + network
                                + " because of unbatched job");
                    }
                    jobsToRun.addAll(batchedJobs);
@@ -3892,8 +3892,12 @@ public class JobSchedulerService extends com.android.server.SystemService
                    // Some job is going to use the CPU anyway. Might as well run all the other
                    // CPU-only jobs.
                    if (DEBUG) {
                        final Integer unbatchedJobCountObj = mUnbatchedJobCount.get(null);
                        final int unbatchedJobCount =
                                unbatchedJobCountObj == null ? 0 : unbatchedJobCountObj;
                        Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: piggybacking "
                                + batchedNonNetworkedJobs.size() + " non-network jobs");
                                + (batchedNonNetworkedJobs.size() - unbatchedJobCount)
                                + " non-network jobs");
                    }
                    jobsToRun.addAll(batchedNonNetworkedJobs);
                } else if (batchedNonNetworkedJobs.size() >= minReadyCount) {