Shift job readiness re-evaluation check.
Sometimes controllers actually update their relative bit on the job when the JobSchedulerService double checks with controllers. However, if JSS is looping through the changedJobs list when this happens, the controller will tell JSS of the change, but adding it to the changedJobs list will be a no-op so the job won't be added to the pending job list. And if the controller gets a callback and evaluate the job on its own, the bit won't change and so the job won't be added to the changedJobs list. This leads to inconsistent behavior based on timing/order of operations. Shifting the controller re-evaluation to when we're determine the job's readiness fixes the issue. Bug: 263216453 Bug: 263699506 Bug: 271128261 Test: atest --rerun-until-failure 50 android.jobscheduler.cts.JobThrottlingTest#testRestrictedEJAllowedWhenAutoRestrictedBucketFeatureOn Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest Change-Id: Idb41cf030f63c697adb8e7bfebc132019f9dffbc
Loading
Please register or sign in to comment