Fix pending queue job presence check.
There are rare situations in which two different JobStatus might return 0 using the Comparator (eg. when persisted jobs are loaded at boot). In those cases, binary search may sometimes return the wrong index. Switch to a linear scan to ensure correctness. Even with the switch to a linear scan, the PendingJobQueue implementation is still more efficient than the prior mechanism (used before the switch to PendingJobQueue). Bug: 228334264 Test: atest FrameworksServicesTests:PendingJobQueueTest Change-Id: I4a31cb1fd5e0a8997eddaed3ecb45a4309abfd59
Loading
Please register or sign in to comment