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

Commit daa3f051 authored by Zhomart Mukhamejanov's avatar Zhomart Mukhamejanov Committed by Automerger Merge Worker
Browse files

Merge "Add javadoc to NetworkStats related classes." am: e51a1d02

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1917019

Change-Id: Ic92ff264664e714cdcf0a8deadf0e9a254ce752e
parents 8c958140 e51a1d02
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -33,7 +33,17 @@ interface INetworkStatsSession {
    @UnsupportedAppUsage
    NetworkStatsHistory getHistoryForNetwork(in NetworkTemplate template, int fields);

    /** Return network layer usage summary per UID for traffic that matches template. */
    /**
     * Return network layer usage summary per UID for traffic that matches template.
     *
     * <p>The resulting {@code NetworkStats#getElapsedRealtime()} contains time delta between
     * {@code start} and {@code end}.
     *
     * @param template - a predicate to filter netstats.
     * @param start - start of the range, timestamp in milliseconds since the epoch.
     * @param end - end of the range, timestamp in milliseconds since the epoch.
     * @param includeTags - includes data usage tags if true.
     */
    @UnsupportedAppUsage
    NetworkStats getSummaryForAllUid(in NetworkTemplate template, long start, long end, boolean includeTags);
    /** Return historical network layer stats for specific UID traffic that matches template. */
+3 −1
Original line number Diff line number Diff line
@@ -220,8 +220,10 @@ public final class NetworkStats implements Parcelable {
    // TODO: move fields to "mVariable" notation

    /**
     * {@link SystemClock#elapsedRealtime()} timestamp when this data was
     * {@link SystemClock#elapsedRealtime()} timestamp in milliseconds when this data was
     * generated.
     * It's a timestamps delta when {@link #subtract()},
     * {@code INetworkStatsSession#getSummaryForAllUid()} methods are used.
     */
    private long elapsedRealtime;
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
+12 −0
Original line number Diff line number Diff line
@@ -526,6 +526,13 @@ public class NetworkStatsHistory implements Parcelable {
    /**
     * Return interpolated data usage across the requested range. Interpolates
     * across buckets, so values may be rounded slightly.
     *
     * <p>If the active bucket is not completed yet, it returns the proportional value of it
     * based on its duration and the {@code end} param.
     *
     * @param start - start of the range, timestamp in milliseconds since the epoch.
     * @param end - end of the range, timestamp in milliseconds since the epoch.
     * @param recycle - entry instance for performance, could be null.
     */
    @UnsupportedAppUsage
    public Entry getValues(long start, long end, Entry recycle) {
@@ -535,6 +542,11 @@ public class NetworkStatsHistory implements Parcelable {
    /**
     * Return interpolated data usage across the requested range. Interpolates
     * across buckets, so values may be rounded slightly.
     *
     * @param start - start of the range, timestamp in milliseconds since the epoch.
     * @param end - end of the range, timestamp in milliseconds since the epoch.
     * @param now - current timestamp in milliseconds since the epoch (wall clock).
     * @param recycle - entry instance for performance, could be null.
     */
    @UnsupportedAppUsage
    public Entry getValues(long start, long end, long now, Entry recycle) {
+9 −4
Original line number Diff line number Diff line
@@ -59,16 +59,15 @@ import com.android.internal.util.FastDataOutput;
import com.android.internal.util.FileRotator;
import com.android.internal.util.IndentingPrintWriter;

import libcore.io.IoUtils;

import com.google.android.collect.Lists;
import com.google.android.collect.Maps;

import libcore.io.IoUtils;

import java.io.BufferedInputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -335,7 +334,13 @@ public class NetworkStatsCollection implements FileRotator.Reader, FileRotator.W

    /**
     * Summarize all {@link NetworkStatsHistory} in this collection which match
     * the requested parameters.
     * the requested parameters across the requested range.
     *
     * @param template - a predicate for filtering netstats.
     * @param start - start of the range, timestamp in milliseconds since the epoch.
     * @param end - end of the range, timestamp in milliseconds since the epoch.
     * @param accessLevel - caller access level.
     * @param callerUid - caller UID.
     */
    public NetworkStats getSummary(NetworkTemplate template, long start, long end,
            @NetworkStatsAccess.Level int accessLevel, int callerUid) {