Fix wallpaper picker crash if folder is in hotseat

Only use mWorkspaceScreens if info.container == CONTAINER_DESKTOP, otherwise assume it's in mHotseat instead.

Test: have a folder in hotseat, open wallpaper picker and can see the preview and set wallpaper
Fixes: 199179718
Change-Id: I6f1dbd8dc387783bb8b76e2bc469508c079a85f8
This commit is contained in:
Tony Wickham
2021-09-07 12:03:07 -07:00
parent 79ff586c10
commit 302eff9c84

View File

@@ -324,7 +324,9 @@ public class LauncherPreviewRenderer extends ContextWrapper
}
private void inflateAndAddFolder(FolderInfo info) {
CellLayout screen = mWorkspaceScreens.get(info.screenId);
CellLayout screen = info.container == Favorites.CONTAINER_DESKTOP
? mWorkspaceScreens.get(info.screenId)
: mHotseat;
FolderIcon folderIcon = FolderIcon.inflateIcon(R.layout.folder_icon, this, screen,
info);
addInScreenFromBind(folderIcon, info);