Retry and ignore ConcurrentModificationException

The flaky callstack shows that it hits the exception in the
initialization of HashSet. The mNetworkRequests is accessed in
the ConnectivityService handler thread except dump(). The
ConcurrentModificationException should not happen in the other
flow. Thus, retry to get the current requests when the dump()
hits the ConcurrentModificationException to prevent flaky test.

Bug: 188373832
Test: atest ConnectivityServiceTest#testDumpDoesNotCrash\
      --iteration 100
Change-Id: I9625919faf947c9488764b92093ed8105271c927
1 file changed