diff options
| author | markchien <markchien@google.com> | 2022-03-01 15:22:20 +0800 |
|---|---|---|
| committer | markchien <markchien@google.com> | 2022-03-07 12:25:47 +0800 |
| commit | 49e944cc1cef1f97c5eef65da96b43eddfca9f9c (patch) | |
| tree | 76ebaf6d75bdfaace506aeb521338499b309dc5c /tests/unit/java | |
| parent | 9edd999725357a6b424a260f5d7ecbcbf604f8c8 (diff) | |
Remove ConnectivityManager swapActiveStatsMap API
swapActiveStatsMap is temporary added for the NetworkStatsFactory to
call BpfNetMaps#swapActiveStatsMap in tethering mainline module. Now
NetworkStatsFactory already be mainlined, calling BpfNetMaps#swapActiveStatsMap
directly.
Bug: 218494448
Test: atest ConnectivityCoverageTests
atest FrameworksNetTests
Change-Id: I3358e4ac5fb7ed0964273afdbccd1b4128ca7645
Diffstat (limited to 'tests/unit/java')
| -rw-r--r-- | tests/unit/java/com/android/server/BpfNetMapsTest.java | 2 | ||||
| -rw-r--r-- | tests/unit/java/com/android/server/net/NetworkStatsFactoryTest.java | 7 |
2 files changed, 0 insertions, 9 deletions
diff --git a/tests/unit/java/com/android/server/BpfNetMapsTest.java b/tests/unit/java/com/android/server/BpfNetMapsTest.java index ac21e77b77..345419b36f 100644 --- a/tests/unit/java/com/android/server/BpfNetMapsTest.java +++ b/tests/unit/java/com/android/server/BpfNetMapsTest.java @@ -78,8 +78,6 @@ public final class BpfNetMapsTest { verify(mNetd).firewallAddUidInterfaceRules(IFNAME, TEST_UIDS); mBpfNetMaps.removeUidInterfaceRules(TEST_UIDS); verify(mNetd).firewallRemoveUidInterfaceRules(TEST_UIDS); - mBpfNetMaps.swapActiveStatsMap(); - verify(mNetd).trafficSwapActiveStatsMap(); mBpfNetMaps.setNetPermForUids(PERMISSION_INTERNET, TEST_UIDS); verify(mNetd).trafficSetNetPermForUids(PERMISSION_INTERNET, TEST_UIDS); } diff --git a/tests/unit/java/com/android/server/net/NetworkStatsFactoryTest.java b/tests/unit/java/com/android/server/net/NetworkStatsFactoryTest.java index 6872f8040c..79744b18c7 100644 --- a/tests/unit/java/com/android/server/net/NetworkStatsFactoryTest.java +++ b/tests/unit/java/com/android/server/net/NetworkStatsFactoryTest.java @@ -32,12 +32,9 @@ import static com.android.server.net.NetworkStatsFactory.kernelToTag; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doReturn; import android.content.Context; import android.content.res.Resources; -import android.net.ConnectivityManager; import android.net.NetworkStats; import android.net.TrafficStats; import android.net.UnderlyingNetworkInfo; @@ -77,7 +74,6 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest { private File mTestProc; private NetworkStatsFactory mFactory; @Mock private Context mContext; - @Mock private ConnectivityManager mCm; @Before public void setUp() throws Exception { @@ -88,9 +84,6 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest { // applications. So in order to have a test support native library, the native code // related to networkStatsFactory is compiled to a minimal native library and loaded here. System.loadLibrary("networkstatsfactorytestjni"); - doReturn(Context.CONNECTIVITY_SERVICE).when(mContext).getSystemServiceName( - eq(ConnectivityManager.class)); - doReturn(mCm).when(mContext).getSystemService(eq(Context.CONNECTIVITY_SERVICE)); mFactory = new NetworkStatsFactory(mContext, mTestProc, false); mFactory.updateUnderlyingNetworkInfos(new UnderlyingNetworkInfo[0]); } |
