Merge "Skip persisting when there's no change." into udc-dev
This commit is contained in:
@@ -727,8 +727,11 @@ public final class JobServiceContext implements ServiceConnection {
|
|||||||
// Exception-throwing-can down the road to JobParameters.completeWork >:(
|
// Exception-throwing-can down the road to JobParameters.completeWork >:(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
mService.mJobs.touchJob(mRunningJob);
|
if (mRunningJob.completeWorkLocked(workId)) {
|
||||||
return mRunningJob.completeWorkLocked(workId);
|
mService.mJobs.touchJob(mRunningJob);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(ident);
|
Binder.restoreCallingIdentity(ident);
|
||||||
|
|||||||
@@ -828,6 +828,10 @@ public final class JobStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code true} if the JobWorkItem queue was updated,
|
||||||
|
* and {@code false} if nothing changed.
|
||||||
|
*/
|
||||||
public boolean completeWorkLocked(int workId) {
|
public boolean completeWorkLocked(int workId) {
|
||||||
if (executingWork != null) {
|
if (executingWork != null) {
|
||||||
final int N = executingWork.size();
|
final int N = executingWork.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user