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.h b/server/TrafficController.h
index 68bb477..71df78f 100644
--- a/server/TrafficController.h
+++ b/server/TrafficController.h
@@ -89,6 +89,12 @@
*/
int deleteTagData(uint32_t tag, uid_t uid);
+ /*
+ * Check if the current device have the bpf traffic stats accounting service
+ * running.
+ */
+ bool checkBpfStatsEnable();
+
private:
/*
* mCookieTagMap: Store the corresponding tag and uid for a specific socket.