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

Commit eb90fa9b authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #63095854: adb shell cmd jobscheduler timeout reports...

..."No matching executing jobs found"

We were not noticing that we actually stopped some jobs.

Also print a message about which jobs we stop, and fix recording
of why a job stopped for this case.

Test: bit CtsJobSchedulerTestCases:*

Change-Id: I178ad2119af4c3187d8c9d4d07a7277bc8a49905
parent 94326cb5
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2052,7 +2052,15 @@ public final class JobSchedulerService extends com.android.server.SystemService
        synchronized (mLock) {
            boolean foundSome = false;
            for (int i=0; i<mActiveServices.size(); i++) {
                mActiveServices.get(i).timeoutIfExecutingLocked(pkgName, userId, hasJobId, jobId);
                final JobServiceContext jc = mActiveServices.get(i);
                final JobStatus js = jc.getRunningJobLocked();
                if (jc.timeoutIfExecutingLocked(pkgName, userId, hasJobId, jobId)) {
                    foundSome = true;
                    pw.print("Timing out: ");
                    js.printUniqueId(pw);
                    pw.print(" ");
                    pw.println(js.getServiceComponent().flattenToShortString());
                }
            }
            if (!foundSome) {
                pw.println("No matching executing jobs found.");
+1 −0
Original line number Diff line number Diff line
@@ -681,6 +681,7 @@ public final class JobServiceContext implements ServiceConnection {
            return;
        }
        try {
            applyStoppedReasonLocked(reason);
            mVerb = VERB_STOPPING;
            scheduleOpTimeOutLocked();
            service.stopJob(mParams);