Boostrap test for NetworkMonitor

This will finally allow to write captive portal detection unit tests.

Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net
Change-Id: I38db1bb79ae80a82b4199dc9cb1b56257e0cf222
This commit is contained in:
Hugo Benichi
2017-07-31 12:58:20 +09:00
parent 71449be2a7
commit 454d55d822
2 changed files with 6 additions and 1 deletions

View File

@@ -278,6 +278,10 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
return mHandler; return mHandler;
} }
public Network network() {
return network;
}
// Functions for manipulating the requests satisfied by this network. // Functions for manipulating the requests satisfied by this network.
// //
// These functions must only called on ConnectivityService's main thread. // These functions must only called on ConnectivityService's main thread.

View File

@@ -683,7 +683,8 @@ public class ConnectivityServiceTest extends AndroidTestCase {
public WrappedNetworkMonitor(Context context, Handler handler, public WrappedNetworkMonitor(Context context, Handler handler,
NetworkAgentInfo networkAgentInfo, NetworkRequest defaultRequest, NetworkAgentInfo networkAgentInfo, NetworkRequest defaultRequest,
IpConnectivityLog log) { IpConnectivityLog log) {
super(context, handler, networkAgentInfo, defaultRequest, log); super(context, handler, networkAgentInfo, defaultRequest, log,
NetworkMonitor.NetworkMonitorSettings.DEFAULT);
} }
@Override @Override