Reduce duplicated code

- This is a test only change.
- Some methods are very similar and duplicated. So merge them to
  improve readability and reduce code complexity.
- Stop spying PermissionMonitor.

Bug: 189705071
Test: atests FrameworksNetTests
Change-Id: I8ec17bd2d396c4d49dd8b64be85d89d0145f4c3c
1 file changed