Fixing preview rendering in device search mode

When the flag is disabled, search box may not show in preview

Bug: 177500166
Test: Presubmit
Change-Id: I064ba6ca22e71030056a4ceafea27e6ef0517d01
(cherry picked from commit e733e79946058b749476f22284043757d3508111)
diff --git a/res/layout/launcher_preview_layout.xml b/res/layout/launcher_preview_layout.xml
index 4a20c70..1691680 100644
--- a/res/layout/launcher_preview_layout.xml
+++ b/res/layout/launcher_preview_layout.xml
@@ -29,23 +29,8 @@
         launcher:containerType="workspace"
         launcher:pageIndicator="@+id/page_indicator"/>
 
-    <com.android.launcher3.Hotseat
+    <include
         android:id="@+id/hotseat"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:importantForAccessibility="no"
-        android:theme="@style/HomeScreenElementTheme"
-        launcher:containerType="hotseat" />
-
-    <com.android.launcher3.InsettableFrameLayout
-        android:id="@+id/apps_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <include
-            android:id="@id/search_container_all_apps"
-            layout="@layout/search_container_all_apps"/>
-
-    </com.android.launcher3.InsettableFrameLayout>
+        layout="@layout/hotseat" />
 
 </com.android.launcher3.InsettableFrameLayout>
\ No newline at end of file
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index efc1201..3a9986e 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -64,7 +64,6 @@
 import com.android.launcher3.LauncherSettings.Favorites;
 import com.android.launcher3.R;
 import com.android.launcher3.WorkspaceLayoutManager;
-import com.android.launcher3.allapps.SearchUiManager;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.folder.FolderIcon;
 import com.android.launcher3.icons.BaseIconFactory;
@@ -512,16 +511,6 @@
             mWorkspace.addViewToCellLayout(qsb, 0, R.id.search_container_workspace, lp, true);
         }
 
-        // Setup search view
-        SearchUiManager searchUiManager = mRootView.findViewById(R.id.search_container_all_apps);
-        mRootView.findViewById(R.id.apps_view).setTranslationY(
-                mDp.heightPx - searchUiManager.getScrollRangeDelta(mInsets));
-        ViewGroup searchView = (ViewGroup) searchUiManager;
-        searchView.setEnabled(false);
-        for (int i = 0; i < searchView.getChildCount(); i++) {
-            searchView.getChildAt(i).setEnabled(false);
-        }
-
         measureView(mRootView, mDp.widthPx, mDp.heightPx);
         dispatchVisibilityAggregated(mRootView, true);
         measureView(mRootView, mDp.widthPx, mDp.heightPx);