Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe313490 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Network stats with varint, omit parcel fields."

parents d6a89b48 63d27a92
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24,9 +24,9 @@ import android.net.NetworkTemplate;
interface INetworkStatsService {

    /** Return historical network layer stats for traffic that matches template. */
    NetworkStatsHistory getHistoryForNetwork(in NetworkTemplate template);
    NetworkStatsHistory getHistoryForNetwork(in NetworkTemplate template, int fields);
    /** Return historical network layer stats for specific UID traffic that matches template. */
    NetworkStatsHistory getHistoryForUid(in NetworkTemplate template, int uid, int tag);
    NetworkStatsHistory getHistoryForUid(in NetworkTemplate template, int uid, int tag, int fields);

    /** Return network layer usage summary for traffic that matches template. */
    NetworkStats getSummaryForNetwork(in NetworkTemplate template, long start, long end);
+14 −9
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class NetworkStats implements Parcelable {
    private long[] rxPackets;
    private long[] txBytes;
    private long[] txPackets;
    private int[] operations;
    private long[] operations;

    public static class Entry {
        public String iface;
@@ -68,13 +68,18 @@ public class NetworkStats implements Parcelable {
        public long rxPackets;
        public long txBytes;
        public long txPackets;
        public int operations;
        public long operations;

        public Entry() {
            this(IFACE_ALL, UID_ALL, TAG_NONE, 0L, 0L, 0L, 0L, 0L);
        }

        public Entry(long rxBytes, long rxPackets, long txBytes, long txPackets, long operations) {
            this(IFACE_ALL, UID_ALL, TAG_NONE, rxBytes, rxPackets, txBytes, txPackets, operations);
        }

        public Entry(String iface, int uid, int tag, long rxBytes, long rxPackets, long txBytes,
                long txPackets, int operations) {
                long txPackets, long operations) {
            this.iface = iface;
            this.uid = uid;
            this.tag = tag;
@@ -96,7 +101,7 @@ public class NetworkStats implements Parcelable {
        this.rxPackets = new long[initialSize];
        this.txBytes = new long[initialSize];
        this.txPackets = new long[initialSize];
        this.operations = new int[initialSize];
        this.operations = new long[initialSize];
    }

    public NetworkStats(Parcel parcel) {
@@ -109,7 +114,7 @@ public class NetworkStats implements Parcelable {
        rxPackets = parcel.createLongArray();
        txBytes = parcel.createLongArray();
        txPackets = parcel.createLongArray();
        operations = parcel.createIntArray();
        operations = parcel.createLongArray();
    }

    /** {@inheritDoc} */
@@ -123,16 +128,16 @@ public class NetworkStats implements Parcelable {
        dest.writeLongArray(rxPackets);
        dest.writeLongArray(txBytes);
        dest.writeLongArray(txPackets);
        dest.writeIntArray(operations);
        dest.writeLongArray(operations);
    }

    public NetworkStats addValues(String iface, int uid, int tag, long rxBytes, long rxPackets,
            long txBytes, long txPackets) {
        return addValues(iface, uid, tag, rxBytes, rxPackets, txBytes, txPackets, 0);
        return addValues(iface, uid, tag, rxBytes, rxPackets, txBytes, txPackets, 0L);
    }

    public NetworkStats addValues(String iface, int uid, int tag, long rxBytes, long rxPackets,
            long txBytes, long txPackets, int operations) {
            long txBytes, long txPackets, long operations) {
        return addValues(
                new Entry(iface, uid, tag, rxBytes, rxPackets, txBytes, txPackets, operations));
    }
@@ -197,7 +202,7 @@ public class NetworkStats implements Parcelable {
    }

    public NetworkStats combineValues(String iface, int uid, int tag, long rxBytes, long rxPackets,
            long txBytes, long txPackets, int operations) {
            long txBytes, long txPackets, long operations) {
        return combineValues(
                new Entry(iface, uid, tag, rxBytes, rxPackets, txBytes, txPackets, operations));
    }
+187 −109

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0

File changed.

Preview size limit exceeded, changes collapsed.

+153 −23

File changed.

Preview size limit exceeded, changes collapsed.

Loading