Use waitForIdle() to wait for Threaded processing.

Unit testing for ConnectivityDiagnostics API in ConnectivityServiceTest
is updated to use HandlerUtilsKt#waitForIdle. In the general case, this
takes the same time to run as verify-with-timeout (used previously).
However, test failures due to messages not being enqueued on the handler
(backed by the ConnectivityService Thread) won't incur the timeout
delay, as the thread will be idle sooner. This shortens the delay in the
event of a programming error.

Bug: 143187964
Test: atest FrameworksNetTests
Change-Id: Iae66309501bb83449ca735dfa5e972a9852cbcd0
1 file changed