Removing global state from DeepShortcutManager

This makes DeepShortcutManager thread-safe and avoids any locks

Change-Id: If4593b3541da6259591ff7a607efa58158006481
This commit is contained in:
Sunny Goyal
2019-07-17 14:30:04 -07:00
parent 273c079761
commit 31ab19f71d
4 changed files with 66 additions and 72 deletions

View File

@@ -317,9 +317,9 @@ public class LoaderTask implements Runnable {
// We can only query for shortcuts when the user is unlocked.
if (userUnlocked) {
List<ShortcutInfo> pinnedShortcuts =
DeepShortcutManager.QueryResult pinnedShortcuts =
mShortcutManager.queryForPinnedShortcuts(null, user);
if (mShortcutManager.wasLastCallSuccess()) {
if (pinnedShortcuts.wasSuccess()) {
for (ShortcutInfo shortcut : pinnedShortcuts) {
shortcutKeyToPinnedShortcuts.put(ShortcutKey.fromInfo(shortcut),
shortcut);