Add connect event reporting
Adds reporting of connect events including netId, destination IP address,
destination port, uid and connect latency.
Also enables the relevant tests in the connect_benchmark.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.
Test: for now just the benchmarking, in the future CTS
Bug: 29748723
(cherry picked from commit 4b9b78aa02336de9291e5085401cef44c03c3bba)
Change-Id: If8e5ddcd2d29271e2f63a3338a3daf83e7afccdc
diff --git a/server/EventReporter.cpp b/server/EventReporter.cpp
index fd09b8a..c9238f4 100644
--- a/server/EventReporter.cpp
+++ b/server/EventReporter.cpp
@@ -37,6 +37,7 @@
}
android::sp<INetdEventListener> EventReporter::getNetdEventListener() {
+ std::lock_guard<std::mutex> lock(mutex);
if (mNetdEventListener == nullptr) {
// Use checkService instead of getService because getService waits for 5 seconds for the
// service to become available. The DNS resolver inside netd is started much earlier in the