Removing workspaceLoaded check from loadDeepShortcuts()

loadDeepShortcuts() is called after loadWorkspace() which already
clears the shortcutMap. So if loader runs twice, during the second run,
workspaceLoaded is true, but the shortcutMap had already been cleared
in loadWorkspace().

Bug: 38384071
Change-Id: I40f0faf88376617e56819aef02620488e528dfb2
This commit is contained in:
Sunny Goyal
2017-05-17 12:05:46 -07:00
parent 02aced9782
commit 4869bf3f74

View File

@@ -1763,17 +1763,15 @@ public class LauncherModel extends BroadcastReceiver
}
private void loadDeepShortcuts() {
if (!mModelLoaded) {
sBgDataModel.deepShortcutMap.clear();
DeepShortcutManager shortcutManager = DeepShortcutManager.getInstance(mContext);
mHasShortcutHostPermission = shortcutManager.hasHostPermission();
if (mHasShortcutHostPermission) {
for (UserHandle user : mUserManager.getUserProfiles()) {
if (mUserManager.isUserUnlocked(user)) {
List<ShortcutInfoCompat> shortcuts =
shortcutManager.queryForAllShortcuts(user);
sBgDataModel.updateDeepShortcutMap(null, user, shortcuts);
}
sBgDataModel.deepShortcutMap.clear();
DeepShortcutManager shortcutManager = DeepShortcutManager.getInstance(mContext);
mHasShortcutHostPermission = shortcutManager.hasHostPermission();
if (mHasShortcutHostPermission) {
for (UserHandle user : mUserManager.getUserProfiles()) {
if (mUserManager.isUserUnlocked(user)) {
List<ShortcutInfoCompat> shortcuts =
shortcutManager.queryForAllShortcuts(user);
sBgDataModel.updateDeepShortcutMap(null, user, shortcuts);
}
}
}