Update VcnNetworkProvider to use thread safe Sets
This patch is to fix a race condition when two threads
access VcnNetworkProvider.mRequests at the same time. The
issue happened when the VCN thread is removing elements and the
binder thread is iterating the Set. It causes the binder thread
to end up with a Null element and throw NPE
This patch fixes this threading issue by changing the Set to
be a thread-safe Set
Bug: 382106220
Test: atest CtsVcnTestCases && atest FrameworksVcnTests
Test: Set up test environment to make the race condition 90%
reproducible; verified the fix by running the test for
100 times on forrest
Flag: EXEMPT; low risk and small scope bug fix
Change-Id: Id7598a861368454efcd0aa49721c54e11aaebdf1
2 files changed