Skip to content
Commit 3b8c41ab authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Reland: More robust updating of "runnable" list.

Whenever BroadcastProcessQueue.getRunnableAt() changes, we need to
check its position in the "runnable" list to ensure it stays sorted.

We've been returning boolean values to indicate when a caller should
invoke updateRunnableList(), so we expand this to more methods that
can have side-effects, and use the "@CheckResult" annotation to
ensure callers don't forget their duty.

It's okay to err on the side of calling updateRunnableList() when
unsure, since it has a fast-path that returns quickly if a queue is
already sorted correctly.

Bug: 274681945
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Test: atest FrameworksMockingServicesTests:BroadcastRecordTest
Change-Id: I877c5f179ba010c53e52d54c75c47583a608ec95
parent d5b0d8c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment