Removing global state from DeepShortcutManager

This makes DeepShortcutManager thread-safe and avoids any locks

Change-Id: If4593b3541da6259591ff7a607efa58158006481
This commit is contained in:
Sunny Goyal committed 2019-07-17 15:16:33 -07:00
1 parent 273c079761
commit 31ab19f71d
4 files changed
+66 -72

No files matched your search

@@ -37,7 +37,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
/**
* Task to handle changing of lock state of the user
@@ -58,9 +57,9 @@ public class UserLockStateChangedTask extends BaseModelUpdateTask {
HashMap<ShortcutKey, ShortcutInfo> pinnedShortcuts = new HashMap<>();
if (isUserUnlocked) {
List<ShortcutInfo> shortcuts =
DeepShortcutManager.QueryResult shortcuts =
deepShortcutManager.queryForPinnedShortcuts(null, mUser);
if (deepShortcutManager.wasLastCallSuccess()) {
if (shortcuts.wasSuccess()) {
for (ShortcutInfo shortcut : shortcuts) {
pinnedShortcuts.put(ShortcutKey.fromInfo(shortcut), shortcut);
}