use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class IpConnectivityEventBuilderTest method testApfProgramEventSerialization.
@SmallTest
public void testApfProgramEventSerialization() {
ConnectivityMetricsEvent ev = describeIpEvent(aType(ApfProgramEvent.class), aLong(200), anInt(7), anInt(9), anInt(2048), anInt(3));
String want = joinLines("dropped_events: 0", "events <", " time_ms: 1", " transport: 0", " apf_program_event <", " current_ras: 9", " drop_multicast: true", " filtered_ras: 7", " has_ipv4_addr: true", " lifetime: 200", " program_length: 2048", " >", ">", "version: 2");
verifySerialization(want, ev);
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class IpConnectivityEventBuilderTest method testDhcpErrorEventSerialization.
@SmallTest
public void testDhcpErrorEventSerialization() {
ConnectivityMetricsEvent ev = describeIpEvent(aType(DhcpErrorEvent.class), aString("wlan0"), anInt(DhcpErrorEvent.L4_NOT_UDP));
String want = joinLines("dropped_events: 0", "events <", " time_ms: 1", " transport: 0", " dhcp_event <", " duration_ms: 0", " if_name: \"wlan0\"", " error_code: 50397184", " >", ">", "version: 2");
verifySerialization(want, ev);
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class IpConnectivityEventBuilderTest method testDhcpClientEventSerialization.
@SmallTest
public void testDhcpClientEventSerialization() {
ConnectivityMetricsEvent ev = describeIpEvent(aType(DhcpClientEvent.class), aString("wlan0"), aString("SomeState"), anInt(192));
String want = joinLines("dropped_events: 0", "events <", " time_ms: 1", " transport: 0", " dhcp_event <", " duration_ms: 192", " if_name: \"wlan0\"", " state_transition: \"SomeState\"", " >", ">", "version: 2");
verifySerialization(want, ev);
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class IpConnectivityEventBuilder method toProto.
public static List<IpConnectivityEvent> toProto(List<ConnectivityMetricsEvent> eventsIn) {
final ArrayList<IpConnectivityEvent> eventsOut = new ArrayList<>(eventsIn.size());
for (ConnectivityMetricsEvent in : eventsIn) {
final IpConnectivityEvent out = toProto(in);
if (out == null) {
continue;
}
eventsOut.add(out);
}
return eventsOut;
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by DirtyUnicorns.
the class IpConnectivityEventBuilderTest method testIpReachabilityEventSerialization.
@SmallTest
public void testIpReachabilityEventSerialization() {
ConnectivityMetricsEvent ev = describeIpEvent(aType(IpReachabilityEvent.class), aString("wlan0"), anInt(IpReachabilityEvent.NUD_FAILED));
String want = joinLines("dropped_events: 0", "events <", " time_ms: 1", " transport: 0", " ip_reachability_event <", " event_type: 512", " if_name: \"wlan0\"", " >", ">", "version: 2");
verifySerialization(want, ev);
}
Aggregations