Some networks may have null ifaces, I guess?
Seems like a bug further upstream, but guard ourselves against it for now. Bug: 17033841 Change-Id: Id0e5895c3389b63d4e34b1fb064efef8b72cd609
This commit is contained in:
committed by
Jeff Sharkey
parent
3b43a279e3
commit
5d6a2cd7ca
@@ -896,10 +896,12 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
// Traffic occurring on the base interface is always counted for
|
// Traffic occurring on the base interface is always counted for
|
||||||
// both total usage and UID details.
|
// both total usage and UID details.
|
||||||
final String baseIface = state.linkProperties.getInterfaceName();
|
final String baseIface = state.linkProperties.getInterfaceName();
|
||||||
findOrCreateNetworkIdentitySet(mActiveIfaces, baseIface).add(ident);
|
if (baseIface != null) {
|
||||||
findOrCreateNetworkIdentitySet(mActiveUidIfaces, baseIface).add(ident);
|
findOrCreateNetworkIdentitySet(mActiveIfaces, baseIface).add(ident);
|
||||||
if (isMobile) {
|
findOrCreateNetworkIdentitySet(mActiveUidIfaces, baseIface).add(ident);
|
||||||
mobileIfaces.add(baseIface);
|
if (isMobile) {
|
||||||
|
mobileIfaces.add(baseIface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Traffic occurring on stacked interfaces is usually clatd,
|
// Traffic occurring on stacked interfaces is usually clatd,
|
||||||
@@ -909,15 +911,16 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
final List<LinkProperties> stackedLinks = state.linkProperties.getStackedLinks();
|
final List<LinkProperties> stackedLinks = state.linkProperties.getStackedLinks();
|
||||||
for (LinkProperties stackedLink : stackedLinks) {
|
for (LinkProperties stackedLink : stackedLinks) {
|
||||||
final String stackedIface = stackedLink.getInterfaceName();
|
final String stackedIface = stackedLink.getInterfaceName();
|
||||||
findOrCreateNetworkIdentitySet(mActiveUidIfaces, stackedIface).add(ident);
|
if (stackedIface != null) {
|
||||||
if (isMobile) {
|
findOrCreateNetworkIdentitySet(mActiveUidIfaces, stackedIface).add(ident);
|
||||||
mobileIfaces.add(stackedIface);
|
if (isMobile) {
|
||||||
|
mobileIfaces.add(stackedIface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mobileIfaces.remove(null);
|
|
||||||
mMobileIfaces = mobileIfaces.toArray(new String[mobileIfaces.size()]);
|
mMobileIfaces = mobileIfaces.toArray(new String[mobileIfaces.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user