Search in sources :

Example 11 with IpConnectivityEvent

use of com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent in project platform_frameworks_base by android.

the class IpConnectivityEventBuilder method toProto.

public static IpConnectivityEvent toProto(ConnectivityMetricsEvent ev) {
    final IpConnectivityEvent out = new IpConnectivityEvent();
    if (!setEvent(out, ev.data)) {
        return null;
    }
    out.timeMs = ev.timestamp;
    return out;
}
Also used : IpConnectivityEvent(com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent)

Example 12 with IpConnectivityEvent

use of com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent in project platform_frameworks_base by android.

the class IpConnectivityEventBuilder method toProto.

public static 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.toArray(new IpConnectivityEvent[eventsOut.size()]);
}
Also used : IpConnectivityEvent(com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent) ArrayList(java.util.ArrayList) ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent)

Example 13 with IpConnectivityEvent

use of com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityEventBuilder method serialize.

public static byte[] serialize(int dropped, List<IpConnectivityEvent> events) throws IOException {
    final IpConnectivityLog log = new IpConnectivityLog();
    log.events = events.toArray(new IpConnectivityEvent[events.size()]);
    log.droppedEvents = dropped;
    if ((log.events.length > 0) || (dropped > 0)) {
        // Only write version number if log has some information at all.
        log.version = IpConnectivityMetrics.VERSION;
    }
    return IpConnectivityLog.toByteArray(log);
}
Also used : IpConnectivityEvent(com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent) IpConnectivityLog(com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityLog)

Example 14 with IpConnectivityEvent

use of com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent in project android_frameworks_base by DirtyUnicorns.

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;
}
Also used : IpConnectivityEvent(com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent) ArrayList(java.util.ArrayList) ConnectivityMetricsEvent(android.net.ConnectivityMetricsEvent)

Example 15 with IpConnectivityEvent

use of com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent in project android_frameworks_base by DirtyUnicorns.

the class NetdEventListenerService method flushConnectStats.

private IpConnectivityEvent flushConnectStats() {
    IpConnectivityEvent ev = new IpConnectivityEvent();
    ev.connectStatistics = mConnectStats.toProto();
    // TODO: add transport information
    mConnectStats = makeConnectStats();
    return ev;
}
Also used : IpConnectivityEvent(com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent)

Aggregations

IpConnectivityEvent (com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityEvent)21 ArrayList (java.util.ArrayList)8 ConnectivityMetricsEvent (android.net.ConnectivityMetricsEvent)5 IpConnectivityLog (com.android.server.connectivity.metrics.IpConnectivityLogClass.IpConnectivityLog)4 SmallTest (android.test.suitebuilder.annotation.SmallTest)3