Merge "Add getters to UnderlyingNetworkInfo" into sc-dev

This commit is contained in:
Aaron Huang
2021-04-22 03:09:41 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 9 deletions

View File

@@ -5904,10 +5904,10 @@ public class ConnectivityServiceTest {
if (vpnUid != null) {
assertEquals("Should have exactly one VPN:", 1, infos.length);
UnderlyingNetworkInfo info = infos[0];
assertEquals("Unexpected VPN owner:", (int) vpnUid, info.ownerUid);
assertEquals("Unexpected VPN interface:", vpnIfname, info.iface);
assertEquals("Unexpected VPN owner:", (int) vpnUid, info.getOwnerUid());
assertEquals("Unexpected VPN interface:", vpnIfname, info.getIface());
assertSameElementsNoDuplicates(underlyingIfaces,
info.underlyingIfaces.toArray(new String[0]));
info.getUnderlyingIfaces().toArray(new String[0]));
} else {
assertEquals(0, infos.length);
return;
@@ -6051,8 +6051,8 @@ public class ConnectivityServiceTest {
// network for the VPN...
verify(mStatsManager, never()).notifyNetworkStatus(any(List.class),
any(List.class), any() /* anyString() doesn't match null */,
argThat(infos -> infos.get(0).underlyingIfaces.size() == 1
&& WIFI_IFNAME.equals(infos.get(0).underlyingIfaces.get(0))));
argThat(infos -> infos.get(0).getUnderlyingIfaces().size() == 1
&& WIFI_IFNAME.equals(infos.get(0).getUnderlyingIfaces().get(0))));
verifyNoMoreInteractions(mStatsManager);
reset(mStatsManager);
@@ -6066,8 +6066,8 @@ public class ConnectivityServiceTest {
waitForIdle();
verify(mStatsManager).notifyNetworkStatus(any(List.class),
any(List.class), any() /* anyString() doesn't match null */,
argThat(vpnInfos -> vpnInfos.get(0).underlyingIfaces.size() == 1
&& WIFI_IFNAME.equals(vpnInfos.get(0).underlyingIfaces.get(0))));
argThat(vpnInfos -> vpnInfos.get(0).getUnderlyingIfaces().size() == 1
&& WIFI_IFNAME.equals(vpnInfos.get(0).getUnderlyingIfaces().get(0))));
mEthernetNetworkAgent.disconnect();
waitForIdle();
reset(mStatsManager);