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

@@ -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);
}