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

Skip to content
Commit 8880128e authored by Pinyao Ting's avatar Pinyao Ting
Browse files

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
parent 8b50a568
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment