Loading core/java/android/net/LinkProperties.java +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.net; import android.annotation.NonNull; import android.annotation.Nullable; import android.net.ProxyInfo; import android.os.Parcelable; import android.os.Parcel; Loading Loading @@ -124,7 +125,7 @@ public final class LinkProperties implements Parcelable { * * @return The interface name set for this link or {@code null}. */ public String getInterfaceName() { public @Nullable String getInterfaceName() { return mIfaceName; } Loading core/java/com/android/internal/os/BatteryStatsImpl.java +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.telephony.DataConnectionRealTimeInfo; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.ArrayMap; import android.util.Log; import android.util.LogWriter; Loading Loading @@ -3744,6 +3745,7 @@ public final class BatteryStatsImpl extends BatteryStats { } public void noteNetworkInterfaceTypeLocked(String iface, int networkType) { if (TextUtils.isEmpty(iface)) return; if (ConnectivityManager.isNetworkTypeMobile(networkType)) { mMobileIfaces = includeInStringArray(mMobileIfaces, iface); if (DEBUG) Slog.d(TAG, "Note mobile iface " + iface + ": " + mMobileIfaces); Loading services/core/java/com/android/server/net/NetworkPolicyManagerService.java +10 −6 Original line number Diff line number Diff line Loading @@ -1060,16 +1060,19 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { final NetworkIdentity ident = NetworkIdentity.buildNetworkIdentity(mContext, state); final String baseIface = state.linkProperties.getInterfaceName(); if (baseIface != null) { connIdents.add(Pair.create(baseIface, ident)); if (powerSave) { connIfaces.add(baseIface); } } // Stacked interfaces are considered to have same identity as // their parent network. final List<LinkProperties> stackedLinks = state.linkProperties.getStackedLinks(); for (LinkProperties stackedLink : stackedLinks) { final String stackedIface = stackedLink.getInterfaceName(); if (stackedIface != null) { connIdents.add(Pair.create(stackedIface, ident)); if (powerSave) { connIfaces.add(stackedIface); Loading @@ -1077,6 +1080,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } } } } // Apply policies against all connected interfaces found above mNetworkRules.clear(); Loading services/core/java/com/android/server/net/NetworkStatsService.java +11 −8 Original line number Diff line number Diff line Loading @@ -896,11 +896,13 @@ public class NetworkStatsService extends INetworkStatsService.Stub { // Traffic occurring on the base interface is always counted for // both total usage and UID details. final String baseIface = state.linkProperties.getInterfaceName(); if (baseIface != null) { findOrCreateNetworkIdentitySet(mActiveIfaces, baseIface).add(ident); findOrCreateNetworkIdentitySet(mActiveUidIfaces, baseIface).add(ident); if (isMobile) { mobileIfaces.add(baseIface); } } // Traffic occurring on stacked interfaces is usually clatd, // which is already accounted against its final egress interface Loading @@ -909,6 +911,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub { final List<LinkProperties> stackedLinks = state.linkProperties.getStackedLinks(); for (LinkProperties stackedLink : stackedLinks) { final String stackedIface = stackedLink.getInterfaceName(); if (stackedIface != null) { findOrCreateNetworkIdentitySet(mActiveUidIfaces, stackedIface).add(ident); if (isMobile) { mobileIfaces.add(stackedIface); Loading @@ -916,8 +919,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub { } } } } mobileIfaces.remove(null); mMobileIfaces = mobileIfaces.toArray(new String[mobileIfaces.size()]); } Loading Loading
core/java/android/net/LinkProperties.java +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.net; import android.annotation.NonNull; import android.annotation.Nullable; import android.net.ProxyInfo; import android.os.Parcelable; import android.os.Parcel; Loading Loading @@ -124,7 +125,7 @@ public final class LinkProperties implements Parcelable { * * @return The interface name set for this link or {@code null}. */ public String getInterfaceName() { public @Nullable String getInterfaceName() { return mIfaceName; } Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.telephony.DataConnectionRealTimeInfo; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.ArrayMap; import android.util.Log; import android.util.LogWriter; Loading Loading @@ -3744,6 +3745,7 @@ public final class BatteryStatsImpl extends BatteryStats { } public void noteNetworkInterfaceTypeLocked(String iface, int networkType) { if (TextUtils.isEmpty(iface)) return; if (ConnectivityManager.isNetworkTypeMobile(networkType)) { mMobileIfaces = includeInStringArray(mMobileIfaces, iface); if (DEBUG) Slog.d(TAG, "Note mobile iface " + iface + ": " + mMobileIfaces); Loading
services/core/java/com/android/server/net/NetworkPolicyManagerService.java +10 −6 Original line number Diff line number Diff line Loading @@ -1060,16 +1060,19 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { final NetworkIdentity ident = NetworkIdentity.buildNetworkIdentity(mContext, state); final String baseIface = state.linkProperties.getInterfaceName(); if (baseIface != null) { connIdents.add(Pair.create(baseIface, ident)); if (powerSave) { connIfaces.add(baseIface); } } // Stacked interfaces are considered to have same identity as // their parent network. final List<LinkProperties> stackedLinks = state.linkProperties.getStackedLinks(); for (LinkProperties stackedLink : stackedLinks) { final String stackedIface = stackedLink.getInterfaceName(); if (stackedIface != null) { connIdents.add(Pair.create(stackedIface, ident)); if (powerSave) { connIfaces.add(stackedIface); Loading @@ -1077,6 +1080,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } } } } // Apply policies against all connected interfaces found above mNetworkRules.clear(); Loading
services/core/java/com/android/server/net/NetworkStatsService.java +11 −8 Original line number Diff line number Diff line Loading @@ -896,11 +896,13 @@ public class NetworkStatsService extends INetworkStatsService.Stub { // Traffic occurring on the base interface is always counted for // both total usage and UID details. final String baseIface = state.linkProperties.getInterfaceName(); if (baseIface != null) { findOrCreateNetworkIdentitySet(mActiveIfaces, baseIface).add(ident); findOrCreateNetworkIdentitySet(mActiveUidIfaces, baseIface).add(ident); if (isMobile) { mobileIfaces.add(baseIface); } } // Traffic occurring on stacked interfaces is usually clatd, // which is already accounted against its final egress interface Loading @@ -909,6 +911,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub { final List<LinkProperties> stackedLinks = state.linkProperties.getStackedLinks(); for (LinkProperties stackedLink : stackedLinks) { final String stackedIface = stackedLink.getInterfaceName(); if (stackedIface != null) { findOrCreateNetworkIdentitySet(mActiveUidIfaces, stackedIface).add(ident); if (isMobile) { mobileIfaces.add(stackedIface); Loading @@ -916,8 +919,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub { } } } } mobileIfaces.remove(null); mMobileIfaces = mobileIfaces.toArray(new String[mobileIfaces.size()]); } Loading