Delay shortcut DB updates to avoid priority inversion.

When working with a large clicklog, updating the shortcuts in the database
after a refresh can be timeconsuming. The update is done on a low priority
background thread, but blocks DB reads which are done on the UI thread. This
can cause priority inversion. By delaying when the updates are performed, we
can reduce how often this priority inversion occurs, which reduces the user
visible latency in the UI.

Change-Id: I58ea6dbd6d1f75bcb477851b49c621d50cd61eb4
2 files changed