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
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index 43ac8f9..7a8b5d8 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -324,7 +324,9 @@
}
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);