ethernet: wait for the interface listener to be registered

If an interface is created before the interface state listener is
registered with the ethernet service, callbacks can get missed.
Specifically, createInterface() expects a down before an up callback. If
the listener registration executes after the event, the listener only
receives the final state event (up in this case).

This was a common source of flakiness in the EthernetManagerTests.

Test: EthernetManagerTest
Bug: 243120665
Merged-In: Iefccc9318a9ea2f929d34a52b7b275bf7a23f443
Change-Id: Iefccc9318a9ea2f929d34a52b7b275bf7a23f443
(cherry picked from commit ef61c582f50b30bdbd193207a954829f3cdbfc60)
1 file changed