Sets taskOverlayFactory to TaskThumbnailViewDeprecated even when not binding

Bug: 339787593
Test: Manual
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Change-Id: I672bf7e5c0fd578974fca16272557f2ef2f218ee
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java
index f7b6496..283bda5 100644
--- a/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java
+++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailViewDeprecated.java
@@ -202,6 +202,17 @@
     }
 
     /**
+     * Sets TaskOverlayFactory without binding a task.
+     *
+     * @deprecated Should only be used when using new
+     * {@link com.android.quickstep.task.thumbnail.TaskThumbnailView}.
+     */
+    @Deprecated
+    public void setTaskOverlayFactory(TaskOverlayFactory taskOverlayFactory) {
+        mTaskOverlayFactory = taskOverlayFactory;
+    }
+
+    /**
      * Updates the thumbnail.
      *
      * @param refreshNow whether the {@code thumbnailData} will be used to redraw immediately.
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.kt b/quickstep/src/com/android/quickstep/views/TaskView.kt
index d19f09c..baeaa87 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.kt
+++ b/quickstep/src/com/android/quickstep/views/TaskView.kt
@@ -630,6 +630,7 @@
                 )
             )
         if (enableRefactorTaskThumbnail()) {
+            taskThumbnailViewDeprecated.setTaskOverlayFactory(taskOverlayFactory)
             bindTaskThumbnailView()
         } else {
             taskThumbnailViewDeprecated.bind(task, taskOverlayFactory)