Fix flaky test: testSetOemNetworkPreferenceForTestPref

- waitForAvailable is checking the NetworkCapabilities that has
  target transport. But calling getNetworkCapabilities in
  available callback is not correct because it should not use
  sync call in async call. Instead, it should wait for
  capabilities callback to check the transport.
- The other callbacks (LP or NC changes) would receive before LOST
  callback. Thus, use eventuallyExpect to replace expectCallback.

Bug: 264769746
Test: atest android.net.cts.ConnectivityManagerTest --iteration
Change-Id: Iaad7a74717c81f3e6236d21981f8a5449b5a6f25
1 file changed