Fix flaky test: testMobileDataPreferredUids

The test is flaky because the wifi network unexpectedly sent a
link properties change before switching the default network to
cellular. To fix this problem, change to eventuallyExpect(),
which can ignore the randomly triggered callbacks and wait for
the expected callback.

Fix: 284533959
Test: atest ConnectivityManagerTest#testMobileDataPreferredUids\
      --iteration 20
Change-Id: Id023b4331c50ae01baf4785868432b207a16cf86
1 file changed