Support 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 change introduces a new API that allows callers to add a set of entries to a NetworkStats instance. This new API will clone the instance only once, return the newly created (and modified) instance, and ensure that the original instance remains immutable. Additionally, the change adopts config libraries for flagging the API and corresponding CTS tests, since Android U-based branches are no longer downstream of current development branches. Test: atest FrameworksNetTests:android.net.connectivity.android.net.netstats.NetworkStatsApiTest Test: atest CtsNetTestCases:NetworkStatsApiTest Bug: 335680025 Fix: 357772271 API-Coverage-Bug: 357772271 Change-Id: I58513844e681c0621a6107ec4b198cd3957f289d
This commit is contained in:
parent
6f6b1a4684
commit
d0e049455c
1 changed files with 90 additions and 27 deletions
|
|
@ -86,6 +86,7 @@ java_defaults {
|
|||
"framework-wifi.stubs.module_lib",
|
||||
],
|
||||
static_libs: [
|
||||
"com.android.net.flags-aconfig-java",
|
||||
// Not using the latest stable version because all functions in the latest version of
|
||||
// mdns_aidl_interface are deprecated.
|
||||
"mdns_aidl_interface-V1-java",
|
||||
|
|
|
|||
Loading…
Reference in a new issue