summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author sangyun <sangyun@google.com> 2023-08-23 10:40:55 +0900
committer Sangyun Yun <sangyun@google.com> 2023-08-23 02:03:01 +0000
commitfbcde60f6161aa5695c6453f00e7cf45f7635bd7 (patch)
treea367c125fef8e5f41fd0020b5540e6e642a1a001 /api/api.go
parentc993acbf140b507064d36d2bfc64d9b72ccdaf13 (diff)
Reduce resource cache size and use LruCache
android.util.LruCache provides least recent used algorithm and has an advantage of not calculating the size every time to find eldest value of LinkedMap. So changed from LinkedMap to LruCache. Size of key configuration, package name, and value Resource are about 300 bytes per one item on average, so even if the cache has 1000 items, it does not use that much heap memory. And the Configuration is logically hard to exceed 1000 types, so it can be considered large enough. Bug: 289045241 Test: atest CtsTelephonyTestCases Test: atest CellBroadcastServiceTests Test: atest GoogleCellBroadcastReceiverUnitTests Test: manually perform telephony tests and validty checks Change-Id: I606013e0a5a69355cdaa9453842ca63fd08d1126
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions