diff options
author | Mark Chien <markchien@google.com> | 2020-05-25 09:11:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-25 09:11:56 +0000 |
commit | 7bfc08f95f981e77279cdc30371804db8d801fe1 (patch) | |
tree | 4a351a84579e04cbd69f63e2f552e80289ef3a60 /src | |
parent | b664b89668e26eff904a5d52eed7e98b2355f2e6 (diff) | |
parent | 90e5d549f9a2f1a95c19aed66c4b06e4ffb54687 (diff) |
Merge "Mock IpConnectivityLog in IpClientTest" into rvc-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/android/net/ip/IpClient.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java index 2079b2b..f3dcdc8 100644 --- a/src/android/net/ip/IpClient.java +++ b/src/android/net/ip/IpClient.java @@ -457,7 +457,7 @@ public class IpClient extends StateMachine { private final SharedLog mLog; private final LocalLog mConnectivityPacketLog; private final MessageHandlingLogger mMsgStateLogger; - private final IpConnectivityLog mMetricsLog = new IpConnectivityLog(); + private final IpConnectivityLog mMetricsLog; private final InterfaceController mInterfaceCtrl; // Ignore nonzero RDNSS option lifetimes below this value. 0 = disabled. @@ -536,6 +536,13 @@ public class IpClient extends StateMachine { return NetworkStackUtils.getDeviceConfigPropertyInt(NAMESPACE_CONNECTIVITY, name, defaultValue); } + + /** + * Get a IpConnectivityLog instance. + */ + public IpConnectivityLog getIpConnectivityLog() { + return new IpConnectivityLog(); + } } public IpClient(Context context, String ifName, IIpClientCallbacks callback, @@ -557,6 +564,7 @@ public class IpClient extends StateMachine { mInterfaceName = ifName; mClatInterfaceName = CLAT_PREFIX + ifName; mDependencies = deps; + mMetricsLog = deps.getIpConnectivityLog(); mShutdownLatch = new CountDownLatch(1); mCm = mContext.getSystemService(ConnectivityManager.class); mObserverRegistry = observerRegistry; |