Add a binder interface checking bpf status
The system server need to know if the bpf traffic stats accounting
system is running at run time before read network stats from it. Instead
of checking the kernel version. A safe way to implement it is adding a
binder call to check the service inside netd. If netd successfully setup
the system and it can be sure the stats will be avalaible for system
server.
Test: run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
Bug: 30950746
Change-Id: Ieef41dd94bc957864108f2f5590d9855ae985244
diff --git a/server/TrafficController.cpp b/server/TrafficController.cpp
index 4cfae36..f9bc909 100644
--- a/server/TrafficController.cpp
+++ b/server/TrafficController.cpp
@@ -418,5 +418,9 @@
return res;
}
+bool TrafficController::checkBpfStatsEnable() {
+ return ebpfSupported;
+}
+
} // namespace net
} // namespace android