commit | 2ed701f162453050ded6f45adbd0dc01b70c593f | [log] [tgz] |
---|---|---|
author | Junyu Lai <junyulai@google.com> | Mon Mar 11 15:45:17 2024 +0800 |
committer | Junyu Lai <junyulai@google.com> | Wed Mar 13 18:13:46 2024 +0800 |
tree | 3b8a6c06f519b3a3191dab6714f06d77c39567a9 | |
parent | 8b1d824ad2e3dd3e14b87f2883d36f0b6a6bc213 [diff] |
Use LruCache to limit the amount of entries This change also implement a getOrCompute method, if the entry is not found in the cache or has expired, computes it using the provided supplier and stores the result in the cache. Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.TrafficStatsRateLimitCacheTest Bug: N/A Change-Id: I60f07e84b7d2c754548b7cd431bd079b0d808c0a