Add a method to help mocking registerNetworkAgent

This is a trick to help mocking registerNetworkAgent without
having to import its return type. In the near future the
return type will be changed to a non-public class, which
can't be seen in CTS.

Really this shouldn't be necessary because only Connectivity
tests should mock ConnectivityManager, but the practice is
different and other mockers need this support.

See also aosp/3538922

Test: NetworkAgentTest
Change-Id: I3ac63d95d3830a3b413f9ad12b84ac426b63dd08
2 files changed