Merge "Stop tracking ghost jobs." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
323def8350
@@ -1745,7 +1745,13 @@ public class JobSchedulerService extends com.android.server.SystemService
|
|||||||
|
|
||||||
// Remove from store as well as controllers.
|
// Remove from store as well as controllers.
|
||||||
final boolean removed = mJobs.remove(jobStatus, removeFromPersisted);
|
final boolean removed = mJobs.remove(jobStatus, removeFromPersisted);
|
||||||
if (removed && mReadyToRock) {
|
if (!removed) {
|
||||||
|
// We never create JobStatus objects for the express purpose of removing them, and this
|
||||||
|
// method is only ever called for jobs that were saved in the JobStore at some point,
|
||||||
|
// so if we can't find it, something went seriously wrong.
|
||||||
|
Slog.wtfStack(TAG, "Job didn't exist in JobStore");
|
||||||
|
}
|
||||||
|
if (mReadyToRock) {
|
||||||
for (int i = 0; i < mControllers.size(); i++) {
|
for (int i = 0; i < mControllers.size(); i++) {
|
||||||
StateController controller = mControllers.get(i);
|
StateController controller = mControllers.get(i);
|
||||||
controller.maybeStopTrackingJobLocked(jobStatus, incomingJob, false);
|
controller.maybeStopTrackingJobLocked(jobStatus, incomingJob, false);
|
||||||
|
|||||||
@@ -992,6 +992,10 @@ public final class JobServiceContext implements ServiceConnection {
|
|||||||
if (mVerb == VERB_FINISHED) {
|
if (mVerb == VERB_FINISHED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (DEBUG) {
|
||||||
|
Slog.d(TAG, "Cleaning up " + mRunningJob.toShortString()
|
||||||
|
+ " reschedule=" + reschedule + " reason=" + reason);
|
||||||
|
}
|
||||||
applyStoppedReasonLocked(reason);
|
applyStoppedReasonLocked(reason);
|
||||||
completedJob = mRunningJob;
|
completedJob = mRunningJob;
|
||||||
final int internalStopReason = mParams.getInternalStopReasonCode();
|
final int internalStopReason = mParams.getInternalStopReasonCode();
|
||||||
|
|||||||
Reference in New Issue
Block a user