diff options
| author | 2022-02-23 19:40:04 +0000 | |
|---|---|---|
| committer | 2022-03-22 23:50:29 +0000 | |
| commit | 8880128e4320d4f8dd9dd584a3210eec1ff9b8ab (patch) | |
| tree | a1690550d6c6e5a69313bab49b41c1904686a639 /libs/androidfw/StringPool.cpp | |
| parent | 8b50a5684111a4a63fb4b9e8d285643dc92829bc (diff) | |
Refrain from choking sysram due to excessive onShortcutChanged callbacks
When developers calls pushDynamicShortcut, LauncherAppService captures a
snapshot (i.e. cloned) of all of the existing shortcuts and passes them
through the callback. We observed an issue where, if the publishing app
decided to push a large quantity (say, 100+) of shortcuts in a for-loop,
we ended up generating a massive amount of shortcut instances (since the
shortcuts passes to the callback is a cloned instance) which leads to
a short burst in memory usage.
This CL debounces the callback by 100ms so that when the developers are
calling pushDynamicShortcut in a for-loop, callback will only be fired
for the last invokation.
Bug: 218545269
Test: manual
Change-Id: I9deca76d15fe9a71574c53031bd7aef7f7740740
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions