Merge changes from topic 'netd-benchmark-and-logging-nyc-mr2-dev' into nyc-mr2-dev
* changes: DO NOT MERGE Add connect event reporting DO NOT MERGE Extending DNS event reporting
This commit is contained in:
committed by
Android (Google) Code Review
commit
b97196b1de
@@ -134,7 +134,9 @@ public class NetdEventListenerService extends INetdEventListener.Stub {
|
||||
|
||||
@Override
|
||||
// Called concurrently by multiple binder threads.
|
||||
public synchronized void onDnsEvent(int netId, int eventType, int returnCode, int latencyMs) {
|
||||
// This method must not block or perform long-running operations.
|
||||
public synchronized void onDnsEvent(int netId, int eventType, int returnCode, int latencyMs,
|
||||
String hostname, String[] ipAddresses, int ipAddressesCount, int uid) {
|
||||
maybeVerboseLog(String.format("onDnsEvent(%d, %d, %d, %d)",
|
||||
netId, eventType, returnCode, latencyMs));
|
||||
|
||||
@@ -146,6 +148,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 + ":");
|
||||
|
||||
@@ -158,7 +158,8 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
|
||||
void log(int netId, int[] latencies) {
|
||||
for (int l : latencies) {
|
||||
mNetdEventListenerService.onDnsEvent(netId, EVENT_TYPE, RETURN_CODE, l);
|
||||
mNetdEventListenerService.onDnsEvent(netId, EVENT_TYPE, RETURN_CODE, l, null, null, 0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user