summaryrefslogtreecommitdiff
path: root/core/java/android/util/SparseSetArray.java
diff options
context:
space:
mode:
authorKweku Adams <kwekua@google.com>2022-04-08 17:54:32 +0000
committerKweku Adams <kwekua@google.com>2022-04-08 18:00:14 +0000
commit5fa3a16679860a1f56bedae62b74184de69b81d5 (patch)
treebe3fe8c2068c197f017ea2ce568d14b577dc83e7 /core/java/android/util/SparseSetArray.java
parente3c41047b4215d33dd4ca749ce0ae68d8ff5415d (diff)
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
Diffstat (limited to 'core/java/android/util/SparseSetArray.java')
0 files changed, 0 insertions, 0 deletions