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

Commit b24d9f45 authored by Ivo Kay's avatar Ivo Kay
Browse files

Cleanup flag and code apply_network_stats_poll_rate_limit

Bug: 409611697
Test: regression tests
Flag: EXEMPT removing apply_network_stats_poll_rate_limit
Change-Id: Ic1f305eb9dd734995125994d69e9879131382a8e
parent 5733f2c4
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ import static com.android.server.am.MemoryStatUtil.readMemoryStatFromFilesystem;
import static com.android.server.stats.Flags.accumulateNetworkStatsSinceBoot;
import static com.android.server.stats.Flags.addMobileBytesTransferByProcStatePuller;
import static com.android.server.stats.Flags.addPressureStallInformationPuller;
import static com.android.server.stats.Flags.applyNetworkStatsPollRateLimit;
import static com.android.server.stats.pull.IonMemoryUtil.readProcessSystemIonHeapSizesFromDebugfs;
import static com.android.server.stats.pull.IonMemoryUtil.readSystemIonHeapSizeFromDebugfs;
import static com.android.server.stats.pull.netstats.NetworkStatsUtils.fromPublicNetworkStats;
@@ -1650,19 +1649,11 @@ public class StatsPullAtomService extends SystemService {
    private NetworkStats getUidNetworkStatsSnapshotForTemplateLocked(
            @NonNull NetworkTemplate template, boolean includeTags, long startTime, long endTime) {
        final long elapsedMillisSinceBoot = SystemClock.elapsedRealtime();
        if (applyNetworkStatsPollRateLimit()) {
            // The new way: rate-limit force-polling for all NetworkStats queries
        // Rate-limit force-polling for all NetworkStats queries
        if (elapsedMillisSinceBoot - mLastNetworkStatsPollTime >= NETSTATS_POLL_RATE_LIMIT_MS) {
            mLastNetworkStatsPollTime = elapsedMillisSinceBoot;
            getNetworkStatsManager().forceUpdate();
        }
        } else {
            // The old way: force-poll only on WiFi queries. Data for other queries can be stale
            // if there was no recent poll beforehand (e.g. for WiFi or scheduled poll)
            if (template.getMatchRule() == MATCH_WIFI && template.getSubscriberIds().isEmpty()) {
                getNetworkStatsManager().forceUpdate();
            }
        }

        final android.app.usage.NetworkStats queryNonTaggedStats =
                getNetworkStatsManager().querySummary(template, startTime, endTime);
+0 −8
Original line number Diff line number Diff line
@@ -23,14 +23,6 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "apply_network_stats_poll_rate_limit"
    namespace: "statsd"
    description: "Apply a rate limit for polling network stats when pulling relevant atoms"
    bug: "352495181"
    is_fixed_read_only: true
}

flag {
    name: "accumulate_network_stats_since_boot"
    namespace: "statsd"