Increase test independence

If a test fails without unregistering an agent, other tests will
see their requests match the old agent. That means any test failing
will fail all subsequent tests, which is not very helpful.

Solve this by making sure the agents are unregistered before the
test ends. Also ensure the requests are unregistered.

Test: NetworkAgentTest
Bug: 139268426
Change-Id: If183d78298aa2a0bcae9e2487199dee14014cdfb
Merged-In: I2c167803d478d31fd85dc6e6e621f35d36c68fb4
(cherry-picked from aosp/1284556)
1 file changed
tree: 8c642cbd6a6e9b246caf4232d8395d2606742839
  1. tests/