[DPM] DO can start network logging and listen for events
This CL adds: 1) Setter and getter in DPM to manipulate logging switch (retrieval method to come in a subsequent CL(s)). 2) A way for DPM to register to listen for events. 3) Skeleton of NetworkLogger class (more to come in subsequent CL(s)). Bug: 29748723 Change-Id: I5c04662ccc6febd2ba294b0eaca1ed1da9c16e47
This commit is contained in:
@@ -22,6 +22,7 @@ import android.net.Network;
|
||||
import android.net.metrics.DnsEvent;
|
||||
import android.net.metrics.INetdEventListener;
|
||||
import android.net.metrics.IpConnectivityLog;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Before;
|
||||
@@ -157,9 +158,13 @@ public class NetdEventListenerServiceTest extends TestCase {
|
||||
}
|
||||
|
||||
void log(int netId, int[] latencies) {
|
||||
try {
|
||||
for (int l : latencies) {
|
||||
mNetdEventListenerService.onDnsEvent(netId, EVENT_TYPE, RETURN_CODE, l, null, null, 0,
|
||||
0);
|
||||
mNetdEventListenerService.onDnsEvent(netId, EVENT_TYPE, RETURN_CODE, l, null, null,
|
||||
0, 0);
|
||||
}
|
||||
} catch (RemoteException re) {
|
||||
throw re.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user