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

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

Merge "Persist "tagged" network stats along with UIDs."

parents 75a0e9c0 d03fd3f0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -26,11 +26,11 @@ interface INetworkStatsService {
    /** Return historical stats for traffic that matches template. */
    NetworkStatsHistory getHistoryForNetwork(in NetworkTemplate template);
    /** Return historical stats for specific UID traffic that matches template. */
    NetworkStatsHistory getHistoryForUid(in NetworkTemplate template, int uid);
    NetworkStatsHistory getHistoryForUid(in NetworkTemplate template, int uid, int tag);

    /** Return usage summary for traffic that matches template. */
    NetworkStats getSummaryForNetwork(in NetworkTemplate template, long start, long end);
    /** Return usage summary per UID for traffic that matches template. */
    NetworkStats getSummaryForAllUid(in NetworkTemplate template, long start, long end);
    NetworkStats getSummaryForAllUid(in NetworkTemplate template, long start, long end, boolean includeTags);

}
+2 −0
Original line number Diff line number Diff line
@@ -3800,6 +3800,8 @@ public final class Settings {
        public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
        /** {@hide} */
        public static final String NETSTATS_UID_MAX_HISTORY = "netstats_uid_max_history";
        /** {@hide} */
        public static final String NETSTATS_TAG_MAX_HISTORY = "netstats_tag_max_history";

        /**
         * @hide
+1 −6
Original line number Diff line number Diff line
@@ -968,11 +968,6 @@ class NetworkManagementService extends INetworkManagementService.Stub {

                    if (limitUid == UID_ALL || limitUid == uid) {
                        stats.addEntry(iface, uid, tag, rx, tx);
                        if (tag != TAG_NONE) {
                            // proc also counts tagged data in generic tag, so
                            // we subtract it here to avoid double-counting.
                            stats.combineEntry(iface, uid, TAG_NONE, -rx, -tx);
                        }
                    }
                } catch (NumberFormatException e) {
                    Slog.w(TAG, "problem parsing stats for idx " + idx + ": " + e);
+149 −66

File changed.

Preview size limit exceeded, changes collapsed.

+194 −30

File changed.

Preview size limit exceeded, changes collapsed.