Fix flakiness in car-support-lib's CarNavigationStatusManagerTest.
The flakiness is caused by notifying listeners of app-focus changes on
the main thread, outside of a synchronised block. So the navigation
status client will request nav focus, then immediately try to send a
navigation status event. Sometimes it would arrive before the navigation
status service receives the notification of app-focus change.
By moving the call to save the focus-change into the main thread
callback, it lines up the calls so that the test will be blocked until
the navigation status renderer service is properly notified.
Overall, this is a pretty flaky design. There's a bunch of different
ways this could be better designed, but I'll just settle for fixing the
test today.
Bug: 73779646
Test: atest AndroidSupportCarApiTest
Change-Id: I12df90ebb08dea2565a9c7322b2c8a4398cd24eb
2 files changed