BroadcastQueue: blocked registered receivers.
In most situations, it's reasonable to shortcut and "assumeDelivered"
for registered receivers as a fire-and-forget operation, since if
that app is wedged it'll only impact delivery of future broadcasts
to that app.
However, for ordered and resultTo broadcasts, there are
often other apps that need to be "blocked" until the receiver actually
finishes. If we "assumeDelivered" in those cases, we'd be subjecting
those other apps to race conditions.
To resolve this, we tighten "assumeDelivered" for these situations,
which also ensure we detect ANRs that would block delivery for other
apps, and add tests to verify.
Bug: 257972988
Test: atest FrameworksMockingServicesTests:BroadcastRecordTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Change-Id: I492aa9ff6f7797e64245c2073db8e2ecddfd8544
10 files changed