Loading services/core/java/com/android/server/connectivity/DefaultNetworkMetrics.java +2 −1 Original line number Diff line number Diff line Loading @@ -150,7 +150,8 @@ public class DefaultNetworkMetrics { fillLinkInfo(ev, newNai); ev.initialScore = newNai.getCurrentScore(); if (newNai.lastValidated) { logDefaultNetworkValidity(timeMs, true); mIsCurrentlyValid = true; mLastValidationTimeMs = timeMs; } } else { mIsCurrentlyValid = false; Loading tests/net/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ LOCAL_JNI_SHARED_LIBRARIES := \ libc++ \ libcrypto \ libcutils \ libdexfile \ libframeworksnettestsjni \ libhidl-gen-utils \ libhidlbase \ Loading tests/net/java/com/android/server/NetworkManagementServiceTest.java +6 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,12 @@ public class NetworkManagementServiceTest { @After public void tearDown() throws Exception { if (mSocket != null) mSocket.close(); if (mServerSocket != null) mServerSocket.close(); mNMService.shutdown(); // Once NetworkManagementService#shutdown() actually does something and shutdowns // the underlying NativeDaemonConnector, the block below should be uncommented. // if (mOutputStream != null) mOutputStream.close(); // if (mSocket != null) mSocket.close(); // if (mServerSocket != null) mServerSocket.close(); } /** Loading tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -175,7 +174,6 @@ public class IpConnectivityMetricsTest { } @Test @Ignore public void testDefaultNetworkEvents() throws Exception { final long cell = BitUtils.packBits(new int[]{NetworkCapabilities.TRANSPORT_CELLULAR}); final long wifi = BitUtils.packBits(new int[]{NetworkCapabilities.TRANSPORT_WIFI}); Loading Loading @@ -294,7 +292,6 @@ public class IpConnectivityMetricsTest { } @Test @Ignore public void testEndToEndLogging() throws Exception { // TODO: instead of comparing textpb to textpb, parse textpb and compare proto to proto. IpConnectivityLog logger = new IpConnectivityLog(mService.impl); Loading Loading @@ -635,6 +632,7 @@ public class IpConnectivityMetricsTest { when(nai.getCurrentScore()).thenReturn(score); nai.linkProperties = new LinkProperties(); nai.networkCapabilities = new NetworkCapabilities(); nai.lastValidated = true; for (int t : BitUtils.unpackBits(transports)) { nai.networkCapabilities.addTransportType(t); } Loading Loading
services/core/java/com/android/server/connectivity/DefaultNetworkMetrics.java +2 −1 Original line number Diff line number Diff line Loading @@ -150,7 +150,8 @@ public class DefaultNetworkMetrics { fillLinkInfo(ev, newNai); ev.initialScore = newNai.getCurrentScore(); if (newNai.lastValidated) { logDefaultNetworkValidity(timeMs, true); mIsCurrentlyValid = true; mLastValidationTimeMs = timeMs; } } else { mIsCurrentlyValid = false; Loading
tests/net/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ LOCAL_JNI_SHARED_LIBRARIES := \ libc++ \ libcrypto \ libcutils \ libdexfile \ libframeworksnettestsjni \ libhidl-gen-utils \ libhidlbase \ Loading
tests/net/java/com/android/server/NetworkManagementServiceTest.java +6 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,12 @@ public class NetworkManagementServiceTest { @After public void tearDown() throws Exception { if (mSocket != null) mSocket.close(); if (mServerSocket != null) mServerSocket.close(); mNMService.shutdown(); // Once NetworkManagementService#shutdown() actually does something and shutdowns // the underlying NativeDaemonConnector, the block below should be uncommented. // if (mOutputStream != null) mOutputStream.close(); // if (mSocket != null) mSocket.close(); // if (mServerSocket != null) mServerSocket.close(); } /** Loading
tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -175,7 +174,6 @@ public class IpConnectivityMetricsTest { } @Test @Ignore public void testDefaultNetworkEvents() throws Exception { final long cell = BitUtils.packBits(new int[]{NetworkCapabilities.TRANSPORT_CELLULAR}); final long wifi = BitUtils.packBits(new int[]{NetworkCapabilities.TRANSPORT_WIFI}); Loading Loading @@ -294,7 +292,6 @@ public class IpConnectivityMetricsTest { } @Test @Ignore public void testEndToEndLogging() throws Exception { // TODO: instead of comparing textpb to textpb, parse textpb and compare proto to proto. IpConnectivityLog logger = new IpConnectivityLog(mService.impl); Loading Loading @@ -635,6 +632,7 @@ public class IpConnectivityMetricsTest { when(nai.getCurrentScore()).thenReturn(score); nai.linkProperties = new LinkProperties(); nai.networkCapabilities = new NetworkCapabilities(); nai.lastValidated = true; for (int t : BitUtils.unpackBits(transports)) { nai.networkCapabilities.addTransportType(t); } Loading