Ignore non-matching callbacks to fix flakiness

This is a host-side tests that receives its network callbacks
through a custom AIDL that proxies them to this host-side
process. As this runs of the real callbacks from a real network,
this test receives unrelated callbacks – in particular calls to
onCapabilitiesUpdated to warn the process of updates of the
signal strength.
This skips these callbacks across the board by only matching
the expected callback. This will fix flakiness in the test.

Also, as a drive-by fix, this also checks the network in
the onBlockedStatusChanged callback. If the network object
is not the expected one, the test should not pass.

Bug: 160270536
Test: NetworkCallbackTests
Original-Change: https://android-review.googlesource.com/1318219
Merged-In: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
Change-Id: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
1 file changed