summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/net/NetworkStatsService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java
index aba75ddb4555..90acda0a1c18 100644
--- a/services/core/java/com/android/server/net/NetworkStatsService.java
+++ b/services/core/java/com/android/server/net/NetworkStatsService.java
@@ -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