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

Commit 6899baf0 authored by Junyu Lai's avatar Junyu Lai
Browse files

Use new NetworkStats#addEntries API

Currently, NetworkStats#addEntry creates a new instance
containing the requested result instead of mutating the
original object. This creates a heavy memory footprint
when the caller invokes it in a loop because a new NetworkStats
instance is created whenever an addEntry is called.

This is a no-op change except it utilizes the newly
created API to add a list of entries at once.
This approach only clones the instance once,
thereby reducing the required memory footprint.

Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.net.BytesTransferredTest
Test: adb shell cmd stats pull-source 10000
Test: atest FrameworksServicesTests:com.android.server.stats.pull.netstats.NetworkStatsUtilsTest
Flag: com.android.server.stats.netstats_use_add_entries
Bug: 335680025
Change-Id: I1b8195d1cacc53e6dc77f154ac1a8108a0220c5b
parent 930130ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment