Loading src/android/net/ip/IpClient.java +9 −1 Original line number Diff line number Diff line Loading @@ -458,7 +458,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. Loading Loading @@ -537,6 +537,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, Loading @@ -558,6 +565,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; Loading tests/unit/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ java_defaults { name: "NetworkStackTestsDefaults", certificate: "platform", platform_apis: true, srcs: ["src/**/*.java", "src/**/*.kt"], resource_dirs: ["res"], static_libs: [ Loading tests/unit/AndroidManifest.xml +0 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.NETWORK_STACK" /> <application android:debuggable="true"> <uses-library android:name="android.test.runner" /> Loading tests/unit/src/android/net/ip/IpClientTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import android.net.MacAddress; import android.net.NetworkStackIpMemoryStore; import android.net.RouteInfo; import android.net.ipmemorystore.NetworkAttributes; import android.net.metrics.IpConnectivityLog; import android.net.shared.InitialConfiguration; import android.net.shared.ProvisioningConfiguration; import android.net.util.InterfaceParams; Loading Loading @@ -120,6 +121,7 @@ public class IpClientTest { @Mock private NetworkStackIpMemoryStore mIpMemoryStore; @Mock private IpMemoryStoreService mIpMemoryStoreService; @Mock private InterfaceParams mInterfaceParams; @Mock private IpConnectivityLog mMetricsLog; private NetworkObserver mObserver; private InterfaceParams mIfParams; Loading @@ -139,6 +141,7 @@ public class IpClientTest { when(mDependencies.getInterfaceParams(any())).thenReturn(mInterfaceParams); when(mDependencies.getIpMemoryStore(mContext, mNetworkStackServiceManager)) .thenReturn(mIpMemoryStore); when(mDependencies.getIpConnectivityLog()).thenReturn(mMetricsLog); mIfParams = null; } Loading Loading
src/android/net/ip/IpClient.java +9 −1 Original line number Diff line number Diff line Loading @@ -458,7 +458,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. Loading Loading @@ -537,6 +537,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, Loading @@ -558,6 +565,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; Loading
tests/unit/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ java_defaults { name: "NetworkStackTestsDefaults", certificate: "platform", platform_apis: true, srcs: ["src/**/*.java", "src/**/*.kt"], resource_dirs: ["res"], static_libs: [ Loading
tests/unit/AndroidManifest.xml +0 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.NETWORK_STACK" /> <application android:debuggable="true"> <uses-library android:name="android.test.runner" /> Loading
tests/unit/src/android/net/ip/IpClientTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import android.net.MacAddress; import android.net.NetworkStackIpMemoryStore; import android.net.RouteInfo; import android.net.ipmemorystore.NetworkAttributes; import android.net.metrics.IpConnectivityLog; import android.net.shared.InitialConfiguration; import android.net.shared.ProvisioningConfiguration; import android.net.util.InterfaceParams; Loading Loading @@ -120,6 +121,7 @@ public class IpClientTest { @Mock private NetworkStackIpMemoryStore mIpMemoryStore; @Mock private IpMemoryStoreService mIpMemoryStoreService; @Mock private InterfaceParams mInterfaceParams; @Mock private IpConnectivityLog mMetricsLog; private NetworkObserver mObserver; private InterfaceParams mIfParams; Loading @@ -139,6 +141,7 @@ public class IpClientTest { when(mDependencies.getInterfaceParams(any())).thenReturn(mInterfaceParams); when(mDependencies.getIpMemoryStore(mContext, mNetworkStackServiceManager)) .thenReturn(mIpMemoryStore); when(mDependencies.getIpConnectivityLog()).thenReturn(mMetricsLog); mIfParams = null; } Loading