Loading core/api/module-lib-current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -223,9 +223,9 @@ package android.net { public final class UnderlyingNetworkInfo implements android.os.Parcelable { ctor public UnderlyingNetworkInfo(int, @NonNull String, @NonNull java.util.List<java.lang.String>); method public int describeContents(); method @NonNull public String getIface(); method @NonNull public String getInterface(); method public int getOwnerUid(); method @NonNull public java.util.List<java.lang.String> getUnderlyingIfaces(); method @NonNull public java.util.List<java.lang.String> getUnderlyingInterfaces(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.UnderlyingNetworkInfo> CREATOR; } Loading core/java/android/net/UnderlyingNetworkInfo.java +4 −4 Original line number Diff line number Diff line Loading @@ -71,13 +71,13 @@ public final class UnderlyingNetworkInfo implements Parcelable { /** Get the interface name of this network. */ @NonNull public String getIface() { public String getInterface() { return mIface; } /** Get the names of the interfaces underlying this network. */ @NonNull public List<String> getUnderlyingIfaces() { public List<String> getUnderlyingInterfaces() { return mUnderlyingIfaces; } Loading Loading @@ -124,8 +124,8 @@ public final class UnderlyingNetworkInfo implements Parcelable { if (!(o instanceof UnderlyingNetworkInfo)) return false; final UnderlyingNetworkInfo that = (UnderlyingNetworkInfo) o; return mOwnerUid == that.getOwnerUid() && Objects.equals(mIface, that.getIface()) && Objects.equals(mUnderlyingIfaces, that.getUnderlyingIfaces()); && Objects.equals(mIface, that.getInterface()) && Objects.equals(mUnderlyingIfaces, that.getUnderlyingInterfaces()); } @Override Loading services/core/java/com/android/server/net/NetworkStatsFactory.java +2 −2 Original line number Diff line number Diff line Loading @@ -382,8 +382,8 @@ public class NetworkStatsFactory { // Migrate data usage over a VPN to the TUN network. for (UnderlyingNetworkInfo info : vpnArray) { delta.migrateTun(info.getOwnerUid(), info.getIface(), info.getUnderlyingIfaces()); delta.migrateTun(info.getOwnerUid(), info.getInterface(), info.getUnderlyingInterfaces()); // Filter out debug entries as that may lead to over counting. delta.filterDebugEntries(); } Loading tests/net/common/java/android/net/UnderlyingNetworkInfoTest.kt +6 −6 Original line number Diff line number Diff line Loading @@ -36,15 +36,15 @@ class UnderlyingNetworkInfoTest { @Test fun testParcelUnparcel() { val testInfo = UnderlyingNetworkInfo(TEST_OWNER_UID, TEST_IFACE, TEST_IFACE_LIST) assertEquals(TEST_OWNER_UID, testInfo.ownerUid) assertEquals(TEST_IFACE, testInfo.iface) assertEquals(TEST_IFACE_LIST, testInfo.underlyingIfaces) assertEquals(TEST_OWNER_UID, testInfo.getOwnerUid()) assertEquals(TEST_IFACE, testInfo.getInterface()) assertEquals(TEST_IFACE_LIST, testInfo.getUnderlyingInterfaces()) assertParcelSane(testInfo, 3) val emptyInfo = UnderlyingNetworkInfo(0, String(), listOf()) assertEquals(0, emptyInfo.ownerUid) assertEquals(String(), emptyInfo.iface) assertEquals(listOf(), emptyInfo.underlyingIfaces) assertEquals(0, emptyInfo.getOwnerUid()) assertEquals(String(), emptyInfo.getInterface()) assertEquals(listOf(), emptyInfo.getUnderlyingInterfaces()) assertParcelSane(emptyInfo, 3) } } No newline at end of file tests/net/java/com/android/server/ConnectivityServiceTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -5898,9 +5898,9 @@ public class ConnectivityServiceTest { assertEquals("Should have exactly one VPN:", 1, infos.length); UnderlyingNetworkInfo info = infos[0]; assertEquals("Unexpected VPN owner:", (int) vpnUid, info.getOwnerUid()); assertEquals("Unexpected VPN interface:", vpnIfname, info.getIface()); assertEquals("Unexpected VPN interface:", vpnIfname, info.getInterface()); assertSameElementsNoDuplicates(underlyingIfaces, info.getUnderlyingIfaces().toArray(new String[0])); info.getUnderlyingInterfaces().toArray(new String[0])); } else { assertEquals(0, infos.length); return; Loading Loading @@ -6044,8 +6044,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).getUnderlyingIfaces().size() == 1 && WIFI_IFNAME.equals(infos.get(0).getUnderlyingIfaces().get(0)))); argThat(infos -> infos.get(0).getUnderlyingInterfaces().size() == 1 && WIFI_IFNAME.equals(infos.get(0).getUnderlyingInterfaces().get(0)))); verifyNoMoreInteractions(mStatsManager); reset(mStatsManager); Loading @@ -6059,8 +6059,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).getUnderlyingIfaces().size() == 1 && WIFI_IFNAME.equals(vpnInfos.get(0).getUnderlyingIfaces().get(0)))); argThat(vpnInfos -> vpnInfos.get(0).getUnderlyingInterfaces().size() == 1 && WIFI_IFNAME.equals(vpnInfos.get(0).getUnderlyingInterfaces().get(0)))); mEthernetNetworkAgent.disconnect(); waitForIdle(); reset(mStatsManager); Loading Loading
core/api/module-lib-current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -223,9 +223,9 @@ package android.net { public final class UnderlyingNetworkInfo implements android.os.Parcelable { ctor public UnderlyingNetworkInfo(int, @NonNull String, @NonNull java.util.List<java.lang.String>); method public int describeContents(); method @NonNull public String getIface(); method @NonNull public String getInterface(); method public int getOwnerUid(); method @NonNull public java.util.List<java.lang.String> getUnderlyingIfaces(); method @NonNull public java.util.List<java.lang.String> getUnderlyingInterfaces(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.net.UnderlyingNetworkInfo> CREATOR; } Loading
core/java/android/net/UnderlyingNetworkInfo.java +4 −4 Original line number Diff line number Diff line Loading @@ -71,13 +71,13 @@ public final class UnderlyingNetworkInfo implements Parcelable { /** Get the interface name of this network. */ @NonNull public String getIface() { public String getInterface() { return mIface; } /** Get the names of the interfaces underlying this network. */ @NonNull public List<String> getUnderlyingIfaces() { public List<String> getUnderlyingInterfaces() { return mUnderlyingIfaces; } Loading Loading @@ -124,8 +124,8 @@ public final class UnderlyingNetworkInfo implements Parcelable { if (!(o instanceof UnderlyingNetworkInfo)) return false; final UnderlyingNetworkInfo that = (UnderlyingNetworkInfo) o; return mOwnerUid == that.getOwnerUid() && Objects.equals(mIface, that.getIface()) && Objects.equals(mUnderlyingIfaces, that.getUnderlyingIfaces()); && Objects.equals(mIface, that.getInterface()) && Objects.equals(mUnderlyingIfaces, that.getUnderlyingInterfaces()); } @Override Loading
services/core/java/com/android/server/net/NetworkStatsFactory.java +2 −2 Original line number Diff line number Diff line Loading @@ -382,8 +382,8 @@ public class NetworkStatsFactory { // Migrate data usage over a VPN to the TUN network. for (UnderlyingNetworkInfo info : vpnArray) { delta.migrateTun(info.getOwnerUid(), info.getIface(), info.getUnderlyingIfaces()); delta.migrateTun(info.getOwnerUid(), info.getInterface(), info.getUnderlyingInterfaces()); // Filter out debug entries as that may lead to over counting. delta.filterDebugEntries(); } Loading
tests/net/common/java/android/net/UnderlyingNetworkInfoTest.kt +6 −6 Original line number Diff line number Diff line Loading @@ -36,15 +36,15 @@ class UnderlyingNetworkInfoTest { @Test fun testParcelUnparcel() { val testInfo = UnderlyingNetworkInfo(TEST_OWNER_UID, TEST_IFACE, TEST_IFACE_LIST) assertEquals(TEST_OWNER_UID, testInfo.ownerUid) assertEquals(TEST_IFACE, testInfo.iface) assertEquals(TEST_IFACE_LIST, testInfo.underlyingIfaces) assertEquals(TEST_OWNER_UID, testInfo.getOwnerUid()) assertEquals(TEST_IFACE, testInfo.getInterface()) assertEquals(TEST_IFACE_LIST, testInfo.getUnderlyingInterfaces()) assertParcelSane(testInfo, 3) val emptyInfo = UnderlyingNetworkInfo(0, String(), listOf()) assertEquals(0, emptyInfo.ownerUid) assertEquals(String(), emptyInfo.iface) assertEquals(listOf(), emptyInfo.underlyingIfaces) assertEquals(0, emptyInfo.getOwnerUid()) assertEquals(String(), emptyInfo.getInterface()) assertEquals(listOf(), emptyInfo.getUnderlyingInterfaces()) assertParcelSane(emptyInfo, 3) } } No newline at end of file
tests/net/java/com/android/server/ConnectivityServiceTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -5898,9 +5898,9 @@ public class ConnectivityServiceTest { assertEquals("Should have exactly one VPN:", 1, infos.length); UnderlyingNetworkInfo info = infos[0]; assertEquals("Unexpected VPN owner:", (int) vpnUid, info.getOwnerUid()); assertEquals("Unexpected VPN interface:", vpnIfname, info.getIface()); assertEquals("Unexpected VPN interface:", vpnIfname, info.getInterface()); assertSameElementsNoDuplicates(underlyingIfaces, info.getUnderlyingIfaces().toArray(new String[0])); info.getUnderlyingInterfaces().toArray(new String[0])); } else { assertEquals(0, infos.length); return; Loading Loading @@ -6044,8 +6044,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).getUnderlyingIfaces().size() == 1 && WIFI_IFNAME.equals(infos.get(0).getUnderlyingIfaces().get(0)))); argThat(infos -> infos.get(0).getUnderlyingInterfaces().size() == 1 && WIFI_IFNAME.equals(infos.get(0).getUnderlyingInterfaces().get(0)))); verifyNoMoreInteractions(mStatsManager); reset(mStatsManager); Loading @@ -6059,8 +6059,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).getUnderlyingIfaces().size() == 1 && WIFI_IFNAME.equals(vpnInfos.get(0).getUnderlyingIfaces().get(0)))); argThat(vpnInfos -> vpnInfos.get(0).getUnderlyingInterfaces().size() == 1 && WIFI_IFNAME.equals(vpnInfos.get(0).getUnderlyingInterfaces().get(0)))); mEthernetNetworkAgent.disconnect(); waitForIdle(); reset(mStatsManager); Loading