From 265494a0f89fc6724ff09c60f072fdeba6285643 Mon Sep 17 00:00:00 2001 From: Michal Karpinski Date: Wed, 28 Sep 2016 16:06:16 +0100 Subject: [PATCH] Add connect event reporting Adds reporting of connect events including netId, destination IP address, destination port, uid and connect latency. 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 965894eeb90c13255b5559b925d13fd22528f8cb) Change-Id: I0c563f26ac39a7e1870153f30d073fc7d0006abc --- .../server/connectivity/NetdEventListenerService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/core/java/com/android/server/connectivity/NetdEventListenerService.java b/services/core/java/com/android/server/connectivity/NetdEventListenerService.java index 4fbfa8ee29c25..f21d9b725f9f0 100644 --- a/services/core/java/com/android/server/connectivity/NetdEventListenerService.java +++ b/services/core/java/com/android/server/connectivity/NetdEventListenerService.java @@ -140,6 +140,14 @@ public class NetdEventListenerService extends INetdEventListener.Stub { batch.addResult((byte) eventType, (byte) returnCode, latencyMs); } + @Override + // Called concurrently by multiple binder threads. + // This method must not block or perform long-running operations. + public synchronized void onConnectEvent(int netId, int latencyMs, String ipAddr, int port, + int uid) { + maybeVerboseLog(String.format("onConnectEvent(%d, %d)", netId, latencyMs)); + } + public synchronized void dump(PrintWriter writer) { IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); pw.println(TAG + ":");