Merge "DO NOT MERGE: use legacy way to get tcp packet count" into pi-dev

am: 15cbfefb03

Change-Id: I7d0498bece672a482e2204424ca5d7780a6c7dc8
This commit is contained in:
Chiachang Wang
2018-07-22 18:57:43 -07:00
committed by android-build-merger

View File

@@ -940,7 +940,13 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
@Override
public long getIfaceStats(String iface, int type) {
return nativeGetIfaceStat(iface, type, checkBpfStatsEnable());
// eBPF code doesn't provide per-interface TCP counters. Use xt_qtaguid for now.
// TODO: delete getMobileTcp(Rx|Tx)Packets entirely. See b/110443385 .
if (type == TYPE_TCP_TX_PACKETS || type == TYPE_TCP_RX_PACKETS) {
return nativeGetIfaceStat(iface, type, false);
} else {
return nativeGetIfaceStat(iface, type, checkBpfStatsEnable());
}
}
@Override