Let netd decide when to swap stats map
To protect stats map from overflow, netd need to know how many stats
entries exist in the current live stats map when tagging the socket. To
prevent racing against framework stats reading actions during tagging
sockets, let netd handle the map swap action instead.
Bug: 111441138
Test: android.app.usage.cts.NetworkUsageStatsTest
android.net.cts.TrafficStatsTest
Change-Id: I1b63e50a67be07472dba32744c8598c1788d0b75
diff --git a/server/NetdNativeService.h b/server/NetdNativeService.h
index def4a3a..518530c 100644
--- a/server/NetdNativeService.h
+++ b/server/NetdNativeService.h
@@ -196,6 +196,8 @@
int32_t direction, int32_t markValue, int32_t markMask,
int32_t interfaceId);
+ binder::Status trafficSwapActiveStatsMap() override;
+
binder::Status ipSecAddTunnelInterface(const std::string& deviceName,
const std::string& localAddress,
const std::string& remoteAddress, int32_t iKey,