Merge "Set iconsSizePx of Taskbar's DeviceProfile directly" into tm-qpr-dev
diff --git a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
index bdac88a..a645e58 100644
--- a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
+++ b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
@@ -210,12 +210,19 @@
             }
 
             case TestProtocol.REQUEST_USE_TEST_WORKSPACE_LAYOUT: {
-                useTestWorkspaceLayout(true);
+                useTestWorkspaceLayout(
+                        LauncherSettings.Settings.ARG_DEFAULT_WORKSPACE_LAYOUT_TEST);
+                return response;
+            }
+
+            case TestProtocol.REQUEST_USE_TEST2_WORKSPACE_LAYOUT: {
+                useTestWorkspaceLayout(
+                        LauncherSettings.Settings.ARG_DEFAULT_WORKSPACE_LAYOUT_TEST2);
                 return response;
             }
 
             case TestProtocol.REQUEST_USE_DEFAULT_WORKSPACE_LAYOUT: {
-                useTestWorkspaceLayout(false);
+                useTestWorkspaceLayout(null);
                 return response;
             }
 
@@ -257,12 +264,17 @@
         }
     }
 
-    private void useTestWorkspaceLayout(boolean useTestWorkspaceLayout) {
+    private void useTestWorkspaceLayout(String layout) {
         final long identity = Binder.clearCallingIdentity();
         try {
-            LauncherSettings.Settings.call(mContext.getContentResolver(), useTestWorkspaceLayout
-                    ? LauncherSettings.Settings.METHOD_SET_USE_TEST_WORKSPACE_LAYOUT_FLAG
-                    : LauncherSettings.Settings.METHOD_CLEAR_USE_TEST_WORKSPACE_LAYOUT_FLAG);
+            if (layout != null) {
+                LauncherSettings.Settings.call(mContext.getContentResolver(),
+                        LauncherSettings.Settings.METHOD_SET_USE_TEST_WORKSPACE_LAYOUT_FLAG,
+                        layout);
+            } else {
+                LauncherSettings.Settings.call(mContext.getContentResolver(),
+                        LauncherSettings.Settings.METHOD_CLEAR_USE_TEST_WORKSPACE_LAYOUT_FLAG);
+            }
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
diff --git a/quickstep/res/layout/taskbar_all_apps.xml b/quickstep/res/layout/taskbar_all_apps.xml
index c7679be..976cd9e 100644
--- a/quickstep/res/layout/taskbar_all_apps.xml
+++ b/quickstep/res/layout/taskbar_all_apps.xml
@@ -27,40 +27,5 @@
         android:clipChildren="true"
         android:clipToPadding="false"
         android:focusable="false"
-        android:saveEnabled="false"
-        android:theme="?attr/allAppsTheme">
-
-        <include
-            layout="@layout/all_apps_bottom_sheet_background"
-            android:visibility="gone" />
-
-        <include
-            layout="@layout/search_results_rv_layout"
-            android:visibility="gone" />
-
-        <include
-            layout="@layout/all_apps_rv_layout"
-            android:visibility="gone" />
-
-        <com.android.launcher3.allapps.FloatingHeaderView
-            android:id="@+id/all_apps_header"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/search_container_all_apps"
-            android:clipToPadding="false"
-            android:orientation="vertical">
-
-            <include layout="@layout/floating_header_content" />
-
-            <include layout="@layout/all_apps_personal_work_tabs" />
-        </com.android.launcher3.allapps.FloatingHeaderView>
-
-        <com.android.launcher3.taskbar.allapps.TaskbarAllAppsFallbackSearchContainer
-            android:id="@+id/search_container_all_apps"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:visibility="gone" />
-
-        <include layout="@layout/all_apps_fast_scroller" />
-    </com.android.launcher3.taskbar.allapps.TaskbarAllAppsContainerView>
+        android:saveEnabled="false" />
 </com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView>
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
index 70405d9..eeca329 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContainerView.java
@@ -17,6 +17,7 @@
 
 import android.content.Context;
 import android.util.AttributeSet;
+import android.view.View;
 import android.view.WindowInsets;
 
 import com.android.launcher3.DeviceProfile;
@@ -43,6 +44,19 @@
     }
 
     @Override
+    protected View inflateSearchBox() {
+        // Remove top padding of header, since we do not have any search
+        mHeader.setPadding(mHeader.getPaddingLeft(), 0,
+                mHeader.getPaddingRight(), mHeader.getPaddingBottom());
+
+        TaskbarAllAppsFallbackSearchContainer searchView =
+                new TaskbarAllAppsFallbackSearchContainer(getContext(), null);
+        searchView.setId(R.id.search_container_all_apps);
+        searchView.setVisibility(GONE);
+        return searchView;
+    }
+
+    @Override
     protected boolean isSearchSupported() {
         return false;
     }
@@ -53,4 +67,10 @@
         // TODO(b/240670050): Remove this and add header protection for the taskbar entrypoint.
         mBottomSheetBackground.setBackgroundResource(R.drawable.bg_rounded_corner_bottom_sheet);
     }
+
+    @Override
+    public boolean isInAllApps() {
+        // All apps is always open
+        return true;
+    }
 }
diff --git a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java
index ebaf60a..38b6dfd 100644
--- a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayContext.java
@@ -21,9 +21,6 @@
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.LauncherPrefs;
 import com.android.launcher3.R;
-import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
 import com.android.launcher3.dot.DotInfo;
 import com.android.launcher3.model.data.ItemInfo;
 import com.android.launcher3.popup.PopupDataProvider;
@@ -137,10 +134,4 @@
 
     @Override
     public void onPopupVisibilityChanged(boolean isVisible) {}
-
-    @Override
-    public SearchAdapterProvider<?> createSearchAdapterProvider(
-            ActivityAllAppsContainerView<?> appsView) {
-        return new DefaultSearchAdapterProvider(this);
-    }
 }
diff --git a/res/drawable/bg_all_apps_searchbox.xml b/res/drawable/bg_all_apps_searchbox.xml
index c324927..3c321e4 100644
--- a/res/drawable/bg_all_apps_searchbox.xml
+++ b/res/drawable/bg_all_apps_searchbox.xml
@@ -15,5 +15,6 @@
 -->
 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
     <solid android:color="?attr/popupColorPrimary" />
-    <corners android:radius="2dp" />
+    <corners android:radius="@dimen/rounded_button_radius" />
+    <stroke android:color="?attr/allappsHeaderProtectionColor" android:width=".5dp" />
 </shape>
\ No newline at end of file
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index f8a871a..655c75d 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -17,13 +17,9 @@
      will bake the left/right padding into that view's background itself. -->
 <com.android.launcher3.allapps.LauncherAllAppsContainerView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/apps_view"
-    android:theme="?attr/allAppsTheme"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:clipChildren="true"
     android:clipToPadding="false"
     android:focusable="false"
-    android:saveEnabled="false">
-
-    <include layout="@layout/all_apps_content" />
-</com.android.launcher3.allapps.LauncherAllAppsContainerView>
\ No newline at end of file
+    android:saveEnabled="false" />
\ No newline at end of file
diff --git a/res/layout/all_apps_content.xml b/res/layout/all_apps_content.xml
index 773ab8d..925f4d9 100644
--- a/res/layout/all_apps_content.xml
+++ b/res/layout/all_apps_content.xml
@@ -34,6 +34,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:clipToPadding="false"
+        android:layout_below="@id/search_container_all_apps"
         android:paddingTop="@dimen/all_apps_header_top_padding"
         android:paddingBottom="@dimen/all_apps_header_bottom_padding"
         android:orientation="vertical" >
@@ -44,15 +45,5 @@
 
     </com.android.launcher3.allapps.FloatingHeaderView>
 
-    <View
-        android:id="@+id/search_protection"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:visibility="gone"
-        android:forceHasOverlappingRendering="false" />
-
-    <include layout="@layout/search_container_all_apps" />
-
     <include layout="@layout/all_apps_fast_scroller" />
-
 </merge>
\ No newline at end of file
diff --git a/res/layout/search_container_all_apps.xml b/res/layout/search_container_all_apps.xml
index b46298c..db218c3 100644
--- a/res/layout/search_container_all_apps.xml
+++ b/res/layout/search_container_all_apps.xml
@@ -21,7 +21,6 @@
     android:layout_centerHorizontal="true"
     android:layout_gravity="top|center_horizontal"
     android:background="@drawable/bg_all_apps_searchbox"
-    android:elevation="1dp"
     android:focusableInTouchMode="true"
     android:gravity="center"
     android:hint="@string/all_apps_search_bar_hint"
diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml
index 4be2e45..f48f3c0 100644
--- a/res/layout/secondary_launcher.xml
+++ b/res/layout/secondary_launcher.xml
@@ -42,8 +42,7 @@
         android:contentDescription="@string/all_apps_button_label"
         android:onClick="onAppsButtonClicked" />
 
-    <view
-        class="com.android.launcher3.allapps.SecondaryLauncherAllAppsContainerView"
+    <com.android.launcher3.allapps.SecondaryLauncherAllAppsContainerView
         android:id="@+id/apps_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
@@ -53,57 +52,5 @@
         android:saveEnabled="false"
         android:layout_gravity="bottom|end"
         android:background="@drawable/round_rect_primary"
-        android:visibility="invisible" >
-
-        <include
-            layout="@layout/all_apps_bottom_sheet_background"
-            android:visibility="gone" />
-
-        <include
-            layout="@layout/search_results_rv_layout"
-            android:visibility="gone" />
-
-        <include
-            layout="@layout/all_apps_rv_layout"
-            android:visibility="gone" />
-
-        <com.android.launcher3.allapps.FloatingHeaderView
-            android:id="@+id/all_apps_header"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/search_container_all_apps"
-            android:clipToPadding="false"
-            android:paddingTop="@dimen/all_apps_header_top_padding"
-            android:orientation="vertical" >
-
-            <include layout="@layout/floating_header_content" />
-            <include layout="@layout/all_apps_personal_work_tabs" />
-        </com.android.launcher3.allapps.FloatingHeaderView>
-
-        <com.android.launcher3.allapps.search.AppsSearchContainerLayout
-            android:id="@id/search_container_all_apps"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/all_apps_search_bar_field_height"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="top|center_horizontal"
-            android:layout_marginTop="24dp"
-            android:background="@drawable/bg_all_apps_searchbox"
-            android:elevation="1dp"
-            android:focusableInTouchMode="true"
-            android:gravity="center"
-            android:hint="@string/all_apps_search_bar_hint"
-            android:imeOptions="actionSearch|flagNoExtractUi"
-            android:importantForAutofill="no"
-            android:inputType="text|textNoSuggestions|textCapWords"
-            android:maxLines="1"
-            android:padding="8dp"
-            android:saveEnabled="false"
-            android:scrollHorizontally="true"
-            android:singleLine="true"
-            android:textColor="?android:attr/textColorSecondary"
-            android:textColorHint="@drawable/all_apps_search_hint"
-            android:textSize="16sp" />
-
-        <include layout="@layout/all_apps_fast_scroller" />
-    </view>
+        android:visibility="invisible" />
 </com.android.launcher3.secondarydisplay.SecondaryDragLayer>
\ No newline at end of file
diff --git a/res/values/config.xml b/res/values/config.xml
index d9b3da5..4cab2de 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -49,9 +49,6 @@
     <!-- View tag key used to determine if we should fade in the child views.. -->
     <string name="popup_container_iterate_children" translatable="false">popup_container_iterate_children</string>
 
-    <!-- config used to determine if header protection is supported in AllApps -->
-    <bool name="config_header_protection_supported">false</bool>
-
     <!-- Workspace -->
     <!-- The duration (in ms) of the fade animation on the object outlines, used when
          we are dragging objects around on the home screen. -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 9e75a31..7582a30 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -20,6 +20,7 @@
 <resources>
     <!-- Launcher theme -->
     <style name="BaseLauncherTheme" parent="@android:style/Theme.DeviceDefault.Light">
+        <item name="disabledIconAlpha">.54</item>
         <item name="android:colorBackgroundCacheHint">@null</item>
         <item name="android:colorEdgeEffect">#FF757575</item>
         <item name="android:windowActionBar">false</item>
@@ -33,7 +34,6 @@
         <item name="allAppsScrimColor">?android:attr/colorBackgroundFloating</item>
         <item name="allappsHeaderProtectionColor">@color/popup_color_tertiary_light</item>
         <item name="allAppsNavBarScrimColor">#66FFFFFF</item>
-        <item name="allAppsTheme">@style/AllAppsTheme</item>
         <item name="popupColorPrimary">@color/popup_color_primary_light</item>
         <item name="popupColorSecondary">@color/popup_color_secondary_light</item>
         <item name="popupColorTertiary">@color/popup_color_tertiary_light</item>
@@ -61,7 +61,6 @@
         <item name="iconOnlyShortcutColor">?android:attr/textColorSecondary</item>
         <item name="workProfileOverlayTextColor">#FF212121</item>
         <item name="eduHalfSheetBGColor">?android:attr/colorAccent</item>
-        <item name="disabledIconAlpha">.54</item>
         <item name="workspaceAccentColor">@color/workspace_accent_color_light</item>
         <item name="dropTargetHoverTextColor">@color/workspace_text_color_dark</item>
         <item name="overviewScrimColor">@color/overview_scrim</item>
@@ -73,14 +72,9 @@
         <item name="android:windowDrawsSystemBarBackgrounds">true</item>
         <item name="android:statusBarColor">#00000000</item>
         <item name="android:navigationBarColor">#00000000</item>
-
-
     </style>
 
-    <style name="LauncherTheme.DarkMainColor" parent="@style/LauncherTheme">
-        <item name="disabledIconAlpha">.54</item>
-
-    </style>
+    <style name="LauncherTheme.DarkMainColor" parent="@style/LauncherTheme" />
 
     <style name="LauncherTheme.DarkText" parent="@style/LauncherTheme">
         <item name="workspaceTextColor">@color/workspace_text_color_dark</item>
@@ -102,7 +96,6 @@
         <item name="android:colorPrimary">#FF212121</item>
         <item name="allAppsScrimColor">?android:attr/colorBackgroundFloating</item>
         <item name="allAppsNavBarScrimColor">#80000000</item>
-        <item name="allAppsTheme">@style/AllAppsTheme.Dark</item>
         <item name="popupColorPrimary">@color/popup_color_primary_dark</item>
         <item name="popupColorSecondary">@color/popup_color_secondary_dark</item>
         <item name="popupColorTertiary">@color/popup_color_tertiary_dark</item>
@@ -129,9 +122,7 @@
         <item name="preloadIconBackgroundColor">@color/preload_icon_background_color_dark</item>
     </style>
 
-    <style name="LauncherTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark">
-        <item name="disabledIconAlpha">.54</item>
-    </style>
+    <style name="LauncherTheme.Dark.DarkMainColor" parent="@style/LauncherTheme.Dark"/>
 
     <style name="LauncherTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark">
         <item name="android:colorControlHighlight">#19212121</item>
@@ -207,14 +198,6 @@
         <item name="android:importantForAccessibility">no</item>
     </style>
 
-    <style name="AllAppsTheme">
-        <item name="disabledIconAlpha">.54</item>
-    </style>
-
-    <style name="AllAppsTheme.Dark">
-        <item name="disabledIconAlpha">.54</item>
-    </style>
-
     <style name="BaseIconRoot" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle"/>
 
     <style name="BaseIconUnBounded" parent="BaseIconRoot">
diff --git a/res/xml/default_test2_workspace.xml b/res/xml/default_test2_workspace.xml
new file mode 100644
index 0000000..c560104
--- /dev/null
+++ b/res/xml/default_test2_workspace.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Split display specific version of Launcher3/res/xml/default_workspace_4x4.xml -->
+<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3" >
+
+    <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
+    <!-- Dialer Messaging Chrome Camera -->
+    <favorite
+        launcher:container="-101"
+        launcher:screen="0"
+        launcher:x="0"
+        launcher:y="0"
+        launcher:className="com.google.android.dialer.extensions.GoogleDialtactsActivity"
+        launcher:packageName="com.google.android.dialer" />
+
+    <favorite
+        launcher:container="-101"
+        launcher:screen="1"
+        launcher:x="1"
+        launcher:y="0"
+        launcher:className="com.google.android.apps.messaging.ui.ConversationListActivity"
+        launcher:packageName="com.google.android.apps.messaging" />
+
+    <favorite
+        launcher:container="-101"
+        launcher:screen="2"
+        launcher:x="2"
+        launcher:y="0"
+        launcher:className="com.google.android.apps.chrome.Main"
+        launcher:packageName="com.android.chrome" />
+
+    <favorite
+        launcher:container="-101"
+        launcher:screen="3"
+        launcher:x="3"
+        launcher:y="0"
+        launcher:className="com.android.camera.CameraLauncher"
+        launcher:packageName="com.google.android.GoogleCamera" />
+
+    <!-- Bottom row -->
+    <!-- Maps [space] [space] Play -->
+    <favorite
+        launcher:className="com.google.android.maps.MapsActivity"
+        launcher:packageName="com.google.android.apps.maps"
+        launcher:screen="0"
+        launcher:x="0"
+        launcher:y="-1" />
+
+    <favorite
+        launcher:className="com.android.vending.AssetBrowserActivity"
+        launcher:packageName="com.android.vending"
+        launcher:screen="0"
+        launcher:x="3"
+        launcher:y="-1" />
+
+    <!-- TODO: Place weather widget when it's available -->
+
+</favorites>
diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java
index 6de3884..ca1fe40 100644
--- a/src/com/android/launcher3/BaseDraggingActivity.java
+++ b/src/com/android/launcher3/BaseDraggingActivity.java
@@ -34,9 +34,6 @@
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
-import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
 import com.android.launcher3.model.data.ItemInfo;
 import com.android.launcher3.touch.ItemClickHandler;
 import com.android.launcher3.util.ActivityOptionsWrapper;
@@ -212,16 +209,6 @@
         return new WindowBounds(new Rect(0, 0, mwSize.x, mwSize.y), new Rect());
     }
 
-    /**
-     * Creates and returns {@link SearchAdapterProvider} for build variant specific search result
-     * views
-     */
-    @Override
-    public SearchAdapterProvider<?> createSearchAdapterProvider(
-            ActivityAllAppsContainerView<?> allApps) {
-        return new DefaultSearchAdapterProvider(this);
-    }
-
     @Override
     public boolean isAppBlockedForSafeMode() {
         return mIsSafeModeEnabled;
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 8ddbbaa..f4c0501 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -106,6 +106,7 @@
     public static final String KEY_LAYOUT_PROVIDER_AUTHORITY = "KEY_LAYOUT_PROVIDER_AUTHORITY";
 
     private static final int TEST_WORKSPACE_LAYOUT_RES_XML = R.xml.default_test_workspace;
+    private static final int TEST2_WORKSPACE_LAYOUT_RES_XML = R.xml.default_test2_workspace;
 
     static final String EMPTY_DATABASE_CREATED = "EMPTY_DATABASE_CREATED";
 
@@ -114,7 +115,7 @@
 
     private long mLastRestoreTimestamp = 0L;
 
-    private boolean mUseTestWorkspaceLayout;
+    private int mDefaultWorkspaceLayoutOverride = 0;
 
     /**
      * $ adb shell dumpsys activity provider com.android.launcher3
@@ -402,11 +403,21 @@
                 return null;
             }
             case LauncherSettings.Settings.METHOD_SET_USE_TEST_WORKSPACE_LAYOUT_FLAG: {
-                mUseTestWorkspaceLayout = true;
+                switch (arg) {
+                    case LauncherSettings.Settings.ARG_DEFAULT_WORKSPACE_LAYOUT_TEST:
+                        mDefaultWorkspaceLayoutOverride = TEST_WORKSPACE_LAYOUT_RES_XML;
+                        break;
+                    case LauncherSettings.Settings.ARG_DEFAULT_WORKSPACE_LAYOUT_TEST2:
+                        mDefaultWorkspaceLayoutOverride = TEST2_WORKSPACE_LAYOUT_RES_XML;
+                        break;
+                    default:
+                        mDefaultWorkspaceLayoutOverride = 0;
+                        break;
+                }
                 return null;
             }
             case LauncherSettings.Settings.METHOD_CLEAR_USE_TEST_WORKSPACE_LAYOUT_FLAG: {
-                mUseTestWorkspaceLayout = false;
+                mDefaultWorkspaceLayoutOverride = 0;
                 return null;
             }
             case LauncherSettings.Settings.METHOD_LOAD_DEFAULT_FAVORITES: {
@@ -628,8 +639,8 @@
 
     private DefaultLayoutParser getDefaultLayoutParser(LauncherWidgetHolder widgetHolder) {
         InvariantDeviceProfile idp = LauncherAppState.getIDP(getContext());
-        int defaultLayout = mUseTestWorkspaceLayout
-                ? TEST_WORKSPACE_LAYOUT_RES_XML : idp.defaultLayoutId;
+        int defaultLayout = mDefaultWorkspaceLayoutOverride > 0
+                ? mDefaultWorkspaceLayoutOverride : idp.defaultLayoutId;
 
         if (getContext().getSystemService(UserManager.class).isDemoUser()
                 && idp.demoModeLayoutId != 0) {
diff --git a/src/com/android/launcher3/LauncherSettings.java b/src/com/android/launcher3/LauncherSettings.java
index 4c8f2d9..932f98a 100644
--- a/src/com/android/launcher3/LauncherSettings.java
+++ b/src/com/android/launcher3/LauncherSettings.java
@@ -377,6 +377,8 @@
 
         public static final String METHOD_SET_USE_TEST_WORKSPACE_LAYOUT_FLAG =
                 "set_use_test_workspace_layout_flag";
+        public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TEST = "default_test_workspace";
+        public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TEST2 = "default_test2_workspace";
 
         public static final String METHOD_CLEAR_USE_TEST_WORKSPACE_LAYOUT_FLAG =
                 "clear_use_test_workspace_layout_flag";
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index e21b4db..2511cada 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -30,7 +30,6 @@
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.views.ActivityContext;
 
@@ -49,12 +48,6 @@
     // Used to animate Search results out and A-Z apps in, or vice-versa.
     private final SearchTransitionController mSearchTransitionController;
 
-    protected SearchUiManager mSearchUiManager;
-    /**
-     * View that defines the search box. Result is rendered inside the recycler view defined in the
-     * base class.
-     */
-    private View mSearchContainer;
     /** {@code true} when rendered view is in search state instead of the scroll state. */
     private boolean mIsSearching;
     private boolean mRebindAdaptersAfterSearchAnimation;
@@ -73,6 +66,12 @@
         mSearchTransitionController = new SearchTransitionController(this);
     }
 
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+        mSearchUiManager.initializeSearch(this);
+    }
+
     public SearchUiManager getSearchUiManager() {
         return mSearchUiManager;
     }
@@ -143,11 +142,6 @@
     }
 
     @Override
-    protected final SearchAdapterProvider<?> createMainAdapterProvider() {
-        return mActivityContext.createSearchAdapterProvider(this);
-    }
-
-    @Override
     public boolean shouldContainerScroll(MotionEvent ev) {
         // IF the MotionEvent is inside the search box, and the container keeps on receiving
         // touch input, container should move down.
@@ -167,14 +161,6 @@
     }
 
     @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-        mSearchContainer = findViewById(R.id.search_container_all_apps);
-        mSearchUiManager = (SearchUiManager) mSearchContainer;
-        mSearchUiManager.initializeSearch(this);
-    }
-
-    @Override
     public boolean dispatchKeyEvent(KeyEvent event) {
         mSearchUiManager.preDispatchKeyEvent(event);
         return super.dispatchKeyEvent(event);
@@ -278,18 +264,6 @@
                 (int) (mSearchContainer.getAlpha() * 255));
     }
 
-    @Override
-    public int getHeaderBottom() {
-        if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
-            if (mActivityContext.getDeviceProfile().isTablet) {
-                return super.getHeaderBottom() + mHeader.getClipTop()
-                        + mBottomSheetBackground.getTop();
-            }
-            return super.getHeaderBottom() + mHeader.getClipTop();
-        }
-        return super.getHeaderBottom() + mSearchContainer.getBottom();
-    }
-
     private void layoutBelowSearchContainer(View v, boolean includeTabsMargin) {
         if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
             return;
@@ -364,4 +338,10 @@
                 ? R.dimen.all_apps_header_pill_height
                 : R.dimen.all_apps_header_top_margin);
     }
+
+    @Override
+    public boolean isInAllApps() {
+        // TODO: Make this abstract
+        return true;
+    }
 }
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
index aea98ae..d1ada7a 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
@@ -60,6 +60,7 @@
 import com.android.launcher3.LauncherPrefs;
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
+import com.android.launcher3.allapps.search.DefaultSearchAdapterProvider;
 import com.android.launcher3.allapps.search.SearchAdapterProvider;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.keyboard.FocusedItemDecorator;
@@ -105,7 +106,6 @@
     protected final List<AdapterHolder> mAH;
     protected final Predicate<ItemInfo> mPersonalMatcher = ItemInfoMatcher.ofUser(
             Process.myUserHandle());
-    private final SearchAdapterProvider<?> mMainAdapterProvider;
     private final AllAppsStore mAllAppsStore = new AllAppsStore();
 
     private final RecyclerView.OnScrollListener mScrollListener =
@@ -123,11 +123,17 @@
 
     protected AllAppsPagedView mViewPager;
     private SearchRecyclerView mSearchRecyclerView;
+    private SearchAdapterProvider<?> mMainAdapterProvider;
 
     protected FloatingHeaderView mHeader;
     protected View mBottomSheetBackground;
     private View mBottomSheetHandleArea;
-    @Nullable private View mSearchBarProtection;
+
+    /**
+     * View that defines the search box. Result is rendered inside {@link #mSearchRecyclerView}.
+     */
+    protected View mSearchContainer;
+    protected SearchUiManager mSearchUiManager;
 
     protected boolean mUsingTabs;
     private boolean mHasWorkApps;
@@ -135,7 +141,7 @@
     protected RecyclerViewFastScroller mTouchHandler;
     protected final Point mFastScrollerOffset = new Point();
 
-    private final int mScrimColor;
+    protected final int mScrimColor;
     private final int mHeaderProtectionColor;
     protected final float mHeaderThreshold;
     private final Path mTmpPath = new Path();
@@ -149,7 +155,6 @@
     protected BaseAllAppsContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
         mActivityContext = ActivityContext.lookupContext(context);
-        mMainAdapterProvider = createMainAdapterProvider();
 
         mScrimColor = Themes.getAttrColor(context, R.attr.allAppsScrimColor);
         mHeaderThreshold = getResources().getDimensionPixelSize(
@@ -160,19 +165,84 @@
                 mActivityContext.getSystemService(UserManager.class),
                 this, LauncherPrefs.getPrefs(mActivityContext));
         mAH = Arrays.asList(null, null, null);
-        mAH.set(AdapterHolder.MAIN, new AdapterHolder(AdapterHolder.MAIN));
-        mAH.set(AdapterHolder.WORK, new AdapterHolder(AdapterHolder.WORK));
-        mAH.set(AdapterHolder.SEARCH, new AdapterHolder(AdapterHolder.SEARCH));
-
         mNavBarScrimPaint = new Paint();
         mNavBarScrimPaint.setColor(Themes.getAttrColor(context, R.attr.allAppsNavBarScrimColor));
 
         mAllAppsStore.addUpdateListener(this::onAppsUpdated);
         mActivityContext.addOnDeviceProfileChangeListener(this);
+
+        // This is a focus listener that proxies focus from a view into the list view.  This is to
+        // work around the search box from getting first focus and showing the cursor.
+        setOnFocusChangeListener((v, hasFocus) -> {
+            if (hasFocus && getActiveRecyclerView() != null) {
+                getActiveRecyclerView().requestFocus();
+            }
+        });
+        initContent();
+    }
+
+    /**
+     * Initializes the view hierarchy and internal variables. Any initialization which actually uses
+     * these members should be done in {@link #onFinishInflate()}.
+     * In terms of subclass initialization, the following would be parallel order for activity:
+     *   initContent -> onPreCreate
+     *   constructor/init -> onCreate
+     *   onFinishInflate -> onPostCreate
+     */
+    protected void initContent() {
+        mMainAdapterProvider = createMainAdapterProvider();
+
+        mAH.set(AdapterHolder.MAIN, new AdapterHolder(AdapterHolder.MAIN));
+        mAH.set(AdapterHolder.WORK, new AdapterHolder(AdapterHolder.WORK));
+        mAH.set(AdapterHolder.SEARCH, new AdapterHolder(AdapterHolder.SEARCH));
+
+        getLayoutInflater().inflate(R.layout.all_apps_content, this);
+        mHeader = findViewById(R.id.all_apps_header);
+        mBottomSheetBackground = findViewById(R.id.bottom_sheet_background);
+        mBottomSheetHandleArea = findViewById(R.id.bottom_sheet_handle_area);
+        mSearchRecyclerView = findViewById(R.id.search_results_list_view);
+
+        // Add the search box next to the header
+        mSearchContainer = inflateSearchBox();
+        addView(mSearchContainer, indexOfChild(mHeader) + 1);
+        mSearchUiManager = (SearchUiManager) mSearchContainer;
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+
+        mAH.get(AdapterHolder.SEARCH).setup(mSearchRecyclerView,
+                /* Filter out A-Z apps */ itemInfo -> false);
+        rebindAdapters(true /* force */);
+        float cornerRadius = Themes.getDialogCornerRadius(getContext());
+        mBottomSheetCornerRadii = new float[]{
+                cornerRadius,
+                cornerRadius, // Top left radius in px
+                cornerRadius,
+                cornerRadius, // Top right radius in px
+                0,
+                0, // Bottom right
+                0,
+                0 // Bottom left
+        };
+        final TypedValue value = new TypedValue();
+        getContext().getTheme().resolveAttribute(android.R.attr.colorBackground, value, true);
+        mBottomSheetBackgroundColor = value.data;
+        updateBackground(mActivityContext.getDeviceProfile());
+    }
+
+    /**
+     * Inflates the search box
+     */
+    protected View inflateSearchBox() {
+        return getLayoutInflater().inflate(R.layout.search_container_all_apps, this, false);
     }
 
     /** Creates the adapter provider for the main section. */
-    protected abstract SearchAdapterProvider<?> createMainAdapterProvider();
+    protected SearchAdapterProvider<?> createMainAdapterProvider() {
+        return new DefaultSearchAdapterProvider(mActivityContext);
+    }
 
     /** The adapter provider for the main section. */
     public final SearchAdapterProvider<?> getMainAdapterProvider() {
@@ -289,6 +359,13 @@
 
     @Override
     public boolean onInterceptTouchEvent(MotionEvent ev) {
+        // The AllAppsContainerView houses the QSB and is hence visible from the Workspace
+        // Overview states. We shouldn't intercept for the scrubber in these cases.
+        if (!isInAllApps()) {
+            mTouchHandler = null;
+            return false;
+        }
+
         if (ev.getAction() == MotionEvent.ACTION_DOWN) {
             AllAppsRecyclerView rv = getActiveRecyclerView();
             if (rv != null && rv.getScrollbar() != null
@@ -306,6 +383,10 @@
 
     @Override
     public boolean onTouchEvent(MotionEvent ev) {
+        if (!isInAllApps()) {
+            return false;
+        }
+
         if (ev.getAction() == MotionEvent.ACTION_DOWN) {
             AllAppsRecyclerView rv = getActiveRecyclerView();
             if (rv != null && rv.getScrollbar() != null
@@ -375,11 +456,6 @@
         return mSearchRecyclerView;
     }
 
-    @Nullable
-    public View getSearchBarProtection() {
-        return mSearchBarProtection;
-    }
-
     protected boolean isPersonalTab() {
         return mViewPager == null || mViewPager.getNextPage() == 0;
     }
@@ -415,49 +491,6 @@
     }
 
     @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-
-        // This is a focus listener that proxies focus from a view into the list view.  This is to
-        // work around the search box from getting first focus and showing the cursor.
-        setOnFocusChangeListener((v, hasFocus) -> {
-            if (hasFocus && getActiveRecyclerView() != null) {
-                getActiveRecyclerView().requestFocus();
-            }
-        });
-
-        mHeader = findViewById(R.id.all_apps_header);
-        mSearchBarProtection = findViewById(R.id.search_protection);
-        if (mSearchBarProtection != null) {
-            mSearchBarProtection.setBackgroundColor(mScrimColor);
-            mSearchBarProtection.setVisibility(
-                    FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get() ? VISIBLE : GONE);
-        }
-        mSearchRecyclerView = findViewById(R.id.search_results_list_view);
-        mAH.get(AdapterHolder.SEARCH).setup(mSearchRecyclerView,
-                /* Filter out A-Z apps */ itemInfo -> false);
-        rebindAdapters(true /* force */);
-
-        mBottomSheetBackground = findViewById(R.id.bottom_sheet_background);
-        mBottomSheetHandleArea = findViewById(R.id.bottom_sheet_handle_area);
-        float cornerRadius = Themes.getDialogCornerRadius(getContext());
-        mBottomSheetCornerRadii = new float[]{
-                cornerRadius,
-                cornerRadius, // Top left radius in px
-                cornerRadius,
-                cornerRadius, // Top right radius in px
-                0,
-                0, // Bottom right
-                0,
-                0 // Bottom left
-        };
-        final TypedValue value = new TypedValue();
-        getContext().getTheme().resolveAttribute(android.R.attr.colorBackground, value, true);
-        mBottomSheetBackgroundColor = value.data;
-        updateBackground(mActivityContext.getDeviceProfile());
-    }
-
-    @Override
     public void onDropCompleted(View target, DragObject d, boolean success) {}
 
     @Override
@@ -781,9 +814,6 @@
             canvas.drawPath(mTmpPath, mHeaderPaint);
         }
 
-        if (!mHeader.isHeaderProtectionSupported()) {
-            return;
-        }
         if (DEBUG_HEADER_PROTECTION) {
             mHeaderPaint.setColor(Color.MAGENTA);
             mHeaderPaint.setAlpha(255);
@@ -796,10 +826,6 @@
         }
         int bottom = getHeaderBottom();
         FloatingHeaderView headerView = getFloatingHeaderView();
-        if (!mUsingTabs && !FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
-            // Add protection which is otherwise added when tabs scroll up.
-            bottom += headerView.getTabsAdditionalPaddingTop();
-        }
         if (isTablet) {
             // Start adding header protection if search bar or tabs will attach to the top.
             if (!FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get() || mUsingTabs) {
@@ -836,7 +862,7 @@
      * redraws header protection
      */
     public void invalidateHeader() {
-        if (mScrimView != null && mHeader.isHeaderProtectionSupported()) {
+        if (mScrimView != null) {
             mScrimView.invalidate();
         }
     }
@@ -863,7 +889,14 @@
             BaseAdapterProvider[] adapterProviders);
 
     public int getHeaderBottom() {
-        return (int) getTranslationY();
+        int bottom = (int) getTranslationY() + mHeader.getClipTop();
+        if (FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()) {
+            if (mActivityContext.getDeviceProfile().isTablet) {
+                return bottom + mBottomSheetBackground.getTop();
+            }
+            return bottom;
+        }
+        return bottom + mHeader.getTop();
     }
 
     /**
@@ -877,6 +910,12 @@
         rv.addOnScrollListener(mScrollListener);
     }
 
+    /**
+     * Returns {@code true} the All Apps UI is currently being displayed on the target surface and
+     * is interactive.
+     */
+    public abstract boolean isInAllApps();
+
     /** Holds a {@link BaseAllAppsAdapter} and related fields. */
     public class AdapterHolder {
         public static final int MAIN = 0;
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index 7fd3752..c18f9e1 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -17,7 +17,6 @@
 
 import android.animation.ValueAnimator;
 import android.content.Context;
-import android.content.res.Configuration;
 import android.graphics.Point;
 import android.graphics.Rect;
 import android.util.ArrayMap;
@@ -85,7 +84,6 @@
     // These two values are necessary to ensure that the header protection is drawn correctly.
     private final int mTabsAdditionalPaddingTop;
     private final int mTabsAdditionalPaddingBottom;
-    private boolean mHeaderProtectionSupported;
 
     protected ViewGroup mTabLayout;
     private AllAppsRecyclerView mMainRV;
@@ -115,7 +113,6 @@
     // enabled or disabled, and represent the current set of all rows.
     private FloatingHeaderRow[] mAllRows = FloatingHeaderRow.NO_ROWS;
 
-
     public FloatingHeaderView(@NonNull Context context) {
         this(context, null);
     }
@@ -126,15 +123,6 @@
                 .getDimensionPixelSize(R.dimen.all_apps_header_top_adjustment);
         mTabsAdditionalPaddingBottom = context.getResources()
                 .getDimensionPixelSize(R.dimen.all_apps_header_bottom_adjustment);
-        mHeaderProtectionSupported = context.getResources().getBoolean(
-                R.bool.config_header_protection_supported);
-    }
-
-    @Override
-    protected void onConfigurationChanged(Configuration newConfig) {
-        super.onConfigurationChanged(newConfig);
-        mHeaderProtectionSupported = getContext().getResources().getBoolean(
-                R.bool.config_header_protection_supported);
     }
 
     @Override
@@ -410,10 +398,6 @@
         return mFloatingRowsHeight;
     }
 
-    int getTabsAdditionalPaddingTop() {
-        return mTabsAdditionalPaddingTop;
-    }
-
     int getTabsAdditionalPaddingBottom() {
         return mTabsAdditionalPaddingBottom;
     }
@@ -454,10 +438,6 @@
         p.y = getTop() - mCurrentRV.getTop() - ((ViewGroup) mCurrentRV.getParent()).getTop();
     }
 
-    public boolean isHeaderProtectionSupported() {
-        return mHeaderProtectionSupported;
-    }
-
     @Override
     public boolean hasOverlappingRendering() {
         return false;
@@ -483,10 +463,6 @@
      * Returns visible height of FloatingHeaderView contents requiring header protection
      */
     int getPeripheralProtectionHeight() {
-        if (!mHeaderProtectionSupported) {
-            return 0;
-        }
-
         // we only want to show protection when work tab is available and header is either
         // collapsed or animating to/from collapsed state
         if (mTabsHidden || mFloatingRowsCollapsed || !mHeaderCollapsed) {
diff --git a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
index 229d8f8..5a5ba2b 100644
--- a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java
@@ -16,61 +16,18 @@
 package com.android.launcher3.allapps;
 
 import android.content.Context;
-import android.text.TextUtils;
 import android.util.AttributeSet;
-import android.view.MotionEvent;
 import android.view.WindowInsets;
 
-import androidx.annotation.NonNull;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.android.launcher3.ExtendedEditText;
 import com.android.launcher3.Launcher;
 import com.android.launcher3.LauncherState;
 import com.android.launcher3.Utilities;
-import com.android.launcher3.config.FeatureFlags;
 
 /**
  * AllAppsContainerView with launcher specific callbacks
  */
 public class LauncherAllAppsContainerView extends ActivityAllAppsContainerView<Launcher> {
 
-    private final RecyclerView.OnScrollListener mActivityScrollListener =
-            new RecyclerView.OnScrollListener() {
-                @Override
-                public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
-                    int scrolledOffset = recyclerView.computeVerticalScrollOffset();
-                    ExtendedEditText input = mSearchUiManager.getEditText();
-                    if (input != null) {
-                        // Save the input box state on scroll down
-                        if (dy > 0) {
-                            input.saveFocusedStateAndUpdateToUnfocusedState();
-                        }
-
-                        // Scroll up and scroll to top
-                        if (dy < 0 && scrolledOffset == 0) {
-                            // Show keyboard
-                            boolean isImeEnabledOnSwipeUp = Launcher.getLauncher(mActivityContext)
-                                    .getSearchConfig().isImeEnabledOnSwipeUp();
-                            if (isImeEnabledOnSwipeUp || !TextUtils.isEmpty(input.getText())) {
-                                input.showKeyboard();
-                            }
-
-                            // Restore state in input box
-                            input.restoreToFocusedState();
-                        }
-                    }
-                }
-            };
-
-    @Override
-    protected void onInitializeRecyclerView(RecyclerView rv) {
-        super.onInitializeRecyclerView(rv);
-        if (FeatureFlags.SCROLL_TOP_TO_RESET.get()) {
-            rv.addOnScrollListener(mActivityScrollListener);
-        }
-    }
-
     public LauncherAllAppsContainerView(Context context) {
         this(context, null);
     }
@@ -84,26 +41,6 @@
     }
 
     @Override
-    public boolean onInterceptTouchEvent(MotionEvent ev) {
-        // The AllAppsContainerView houses the QSB and is hence visible from the Workspace
-        // Overview states. We shouldn't intercept for the scrubber in these cases.
-        if (!mActivityContext.isInState(LauncherState.ALL_APPS)) {
-            mTouchHandler = null;
-            return false;
-        }
-
-        return super.onInterceptTouchEvent(ev);
-    }
-
-    @Override
-    public boolean onTouchEvent(MotionEvent ev) {
-        if (!mActivityContext.isInState(LauncherState.ALL_APPS)) {
-            return false;
-        }
-        return super.onTouchEvent(ev);
-    }
-
-    @Override
     protected int getNavBarScrimHeight(WindowInsets insets) {
         if (Utilities.ATLEAST_Q) {
             return insets.getTappableElementInsets().bottom;
@@ -111,4 +48,9 @@
             return insets.getStableInsetBottom();
         }
     }
+
+    @Override
+    public boolean isInAllApps() {
+        return mActivityContext.getStateManager().isInStableState(LauncherState.ALL_APPS);
+    }
 }
diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java
index 495f5c3..5056782 100644
--- a/src/com/android/launcher3/allapps/SearchTransitionController.java
+++ b/src/com/android/launcher3/allapps/SearchTransitionController.java
@@ -36,8 +36,6 @@
 import android.view.animation.Interpolator;
 
 import com.android.launcher3.BubbleTextView;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherState;
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.config.FeatureFlags;
@@ -109,9 +107,7 @@
         }
 
         mSearchToAzAnimator = ObjectAnimator.ofFloat(this, SEARCH_TO_AZ_PROGRESS, targetProgress);
-        boolean inAllApps = Launcher.getLauncher(
-                mAllAppsContainerView.getContext()).getStateManager().isInStableState(
-                LauncherState.ALL_APPS);
+        boolean inAllApps = mAllAppsContainerView.isInAllApps();
         if (!inAllApps) {
             duration = 0;  // Don't want to animate when coming from QSB.
         }
diff --git a/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java
index 0719c43..684e98e 100644
--- a/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/SecondaryLauncherAllAppsContainerView.java
@@ -42,4 +42,9 @@
 
     @Override
     protected void updateBackground(DeviceProfile deviceProfile) {}
+
+    @Override
+    public boolean isInAllApps() {
+        return mActivityContext.isAppDrawerShown();
+    }
 }
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 4cb4348..3e2d051 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -53,6 +53,7 @@
 import com.android.launcher3.model.WidgetsModel;
 import com.android.launcher3.states.RotationHelper;
 import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
+import com.android.launcher3.util.DisplayController;
 
 import java.util.Collections;
 import java.util.List;
@@ -267,15 +268,14 @@
                     return !WidgetsModel.GO_DISABLE_NOTIFICATION_DOTS;
 
                 case ALLOW_ROTATION_PREFERENCE_KEY:
-                    DeviceProfile deviceProfile = InvariantDeviceProfile.INSTANCE.get(
-                            getContext()).getDeviceProfile(getContext());
-                    if (deviceProfile.isTablet) {
+                    DisplayController.Info info = InvariantDeviceProfile.INSTANCE.get(
+                            getContext()).getDeviceProfile(getContext()).getDisplayInfo();
+                    if (info.isTablet(info.realBounds)) {
                         // Launcher supports rotation by default. No need to show this setting.
                         return false;
                     }
                     // Initialize the UI once
-                    preference.setDefaultValue(
-                            RotationHelper.getAllowRotationDefaultValue(deviceProfile));
+                    preference.setDefaultValue(RotationHelper.getAllowRotationDefaultValue(info));
                     return true;
 
                 case FLAGS_PREFERENCE_KEY:
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index 642bdcd..e5b4eba 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -35,7 +35,6 @@
 import androidx.annotation.WorkerThread;
 
 import com.android.launcher3.BaseActivity;
-import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.LauncherPrefs;
 import com.android.launcher3.util.DisplayController;
 
@@ -50,11 +49,11 @@
     /**
      * Returns the default value of {@link #ALLOW_ROTATION_PREFERENCE_KEY} preference.
      */
-    public static boolean getAllowRotationDefaultValue(DeviceProfile deviceProfile) {
+    public static boolean getAllowRotationDefaultValue(DisplayController.Info info) {
         // If the device's pixel density was scaled (usually via settings for A11y), use the
         // original dimensions to determine if rotation is allowed of not.
-        float originalSmallestWidth = dpiFromPx(
-                Math.min(deviceProfile.widthPx, deviceProfile.heightPx), DENSITY_DEVICE_STABLE);
+        float originalSmallestWidth = dpiFromPx(Math.min(info.currentSize.x, info.currentSize.y),
+                DENSITY_DEVICE_STABLE);
         return originalSmallestWidth >= MIN_TABLET_WIDTH;
     }
 
@@ -99,7 +98,8 @@
                 new Handler(UI_HELPER_EXECUTOR.getLooper(), this::setOrientationAsync);
     }
 
-    private void setIgnoreAutoRotateSettings(boolean ignoreAutoRotateSettings) {
+    private void setIgnoreAutoRotateSettings(boolean ignoreAutoRotateSettings,
+            DisplayController.Info info) {
         // On large devices we do not handle auto-rotate differently.
         mIgnoreAutoRotateSettings = ignoreAutoRotateSettings;
         if (!mIgnoreAutoRotateSettings) {
@@ -108,7 +108,7 @@
                 mSharedPrefs.registerOnSharedPreferenceChangeListener(this);
             }
             mHomeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY,
-                    getAllowRotationDefaultValue(mActivity.getDeviceProfile()));
+                    getAllowRotationDefaultValue(info));
         } else {
             if (mSharedPrefs != null) {
                 mSharedPrefs.unregisterOnSharedPreferenceChangeListener(this);
@@ -122,7 +122,7 @@
         if (mDestroyed || mIgnoreAutoRotateSettings) return;
         boolean wasRotationEnabled = mHomeRotationEnabled;
         mHomeRotationEnabled = mSharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY,
-                getAllowRotationDefaultValue(mActivity.getDeviceProfile()));
+                getAllowRotationDefaultValue(mActivity.getDeviceProfile().getDisplayInfo()));
         if (mHomeRotationEnabled != wasRotationEnabled) {
             notifyChange();
         }
@@ -132,7 +132,7 @@
     public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
         boolean ignoreAutoRotateSettings = info.isTablet(info.realBounds);
         if (mIgnoreAutoRotateSettings != ignoreAutoRotateSettings) {
-            setIgnoreAutoRotateSettings(ignoreAutoRotateSettings);
+            setIgnoreAutoRotateSettings(ignoreAutoRotateSettings, info);
             notifyChange();
         }
     }
@@ -169,7 +169,7 @@
             mInitialized = true;
             DisplayController displayController = DisplayController.INSTANCE.get(mActivity);
             DisplayController.Info info = displayController.getInfo();
-            setIgnoreAutoRotateSettings(info.isTablet(info.realBounds));
+            setIgnoreAutoRotateSettings(info.isTablet(info.realBounds), info);
             displayController.addChangeListener(this);
             notifyChange();
         }
diff --git a/src/com/android/launcher3/testing/shared/TestProtocol.java b/src/com/android/launcher3/testing/shared/TestProtocol.java
index 46e5891..1deb23d 100644
--- a/src/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/src/com/android/launcher3/testing/shared/TestProtocol.java
@@ -106,6 +106,7 @@
     public static final String REQUEST_STOP_EVENT_LOGGING = "stop-event-logging";
     public static final String REQUEST_CLEAR_DATA = "clear-data";
     public static final String REQUEST_USE_TEST_WORKSPACE_LAYOUT = "use-test-workspace-layout";
+    public static final String REQUEST_USE_TEST2_WORKSPACE_LAYOUT = "use-test2-workspace-layout";
     public static final String REQUEST_USE_DEFAULT_WORKSPACE_LAYOUT =
             "use-default-workspace-layout";
     public static final String REQUEST_HOTSEAT_ICON_NAMES = "get-hotseat-icon-names";
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 820162c..097823b 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -432,10 +432,10 @@
             int drawableWidth, int drawableHeight, DeviceProfile dp,
             @StagePosition int stagePosition) {
         float insetAdjustment = getPlaceholderSizeAdjustment(dp) / 2f;
-        out.setX(Math.round(onScreenRectCenterX / fullscreenScaleX
-                - 1.0f * drawableWidth / 2));
-        out.setY(Math.round((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
-                - 1.0f * drawableHeight / 2));
+        out.setX(onScreenRectCenterX / fullscreenScaleX
+                - 1.0f * drawableWidth / 2);
+        out.setY((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
+                - 1.0f * drawableHeight / 2);
     }
 
     /**
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index 78e17d8..316cf0e 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -463,20 +463,20 @@
         boolean pinToRight = stagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT;
         float insetAdjustment = getPlaceholderSizeAdjustment(dp, pinToRight) / 2f;
         if (!dp.isLandscape) {
-            out.setX(Math.round(onScreenRectCenterX / fullscreenScaleX
-                    - 1.0f * drawableWidth / 2));
-            out.setY(Math.round((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
-                    - 1.0f * drawableHeight / 2));
+            out.setX(onScreenRectCenterX / fullscreenScaleX
+                    - 1.0f * drawableWidth / 2);
+            out.setY((onScreenRectCenterY + insetAdjustment) / fullscreenScaleY
+                    - 1.0f * drawableHeight / 2);
         } else {
             if (pinToRight) {
-                out.setX(Math.round((onScreenRectCenterX - insetAdjustment) / fullscreenScaleX
-                        - 1.0f * drawableWidth / 2));
+                out.setX((onScreenRectCenterX - insetAdjustment) / fullscreenScaleX
+                        - 1.0f * drawableWidth / 2);
             } else {
-                out.setX(Math.round((onScreenRectCenterX + insetAdjustment) / fullscreenScaleX
-                        - 1.0f * drawableWidth / 2));
+                out.setX((onScreenRectCenterX + insetAdjustment) / fullscreenScaleX
+                        - 1.0f * drawableWidth / 2);
             }
-            out.setY(Math.round(onScreenRectCenterY / fullscreenScaleY
-                    - 1.0f * drawableHeight / 2));
+            out.setY(onScreenRectCenterY / fullscreenScaleY
+                    - 1.0f * drawableHeight / 2);
         }
     }
 
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index 28085e1..79b4cb4 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -54,7 +54,6 @@
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.allapps.ActivityAllAppsContainerView;
-import com.android.launcher3.allapps.search.SearchAdapterProvider;
 import com.android.launcher3.dot.DotInfo;
 import com.android.launcher3.dragndrop.DragController;
 import com.android.launcher3.folder.FolderIcon;
@@ -229,16 +228,6 @@
     }
 
     /**
-     * Creates and returns {@link SearchAdapterProvider} for build variant specific search result
-     * views.
-     */
-    @Nullable
-    default SearchAdapterProvider<?> createSearchAdapterProvider(
-            ActivityAllAppsContainerView<?> appsView) {
-        return null;
-    }
-
-    /**
      * Hides the keyboard if it is visible
      */
     default void hideKeyboard() {
diff --git a/src/com/android/launcher3/views/ArrowTipView.java b/src/com/android/launcher3/views/ArrowTipView.java
index 8d16a8d..73c5ad4 100644
--- a/src/com/android/launcher3/views/ArrowTipView.java
+++ b/src/com/android/launcher3/views/ArrowTipView.java
@@ -162,6 +162,7 @@
         params.gravity = gravity;
         params.leftMargin = mArrowMinOffset + grid.getInsets().left;
         params.rightMargin = mArrowMinOffset + grid.getInsets().right;
+        params.width = LayoutParams.MATCH_PARENT;
         LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mArrowView.getLayoutParams();
 
         lp.gravity = gravity;
diff --git a/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java b/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java
index b7ad7f2..6a938da 100644
--- a/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java
+++ b/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java
@@ -21,8 +21,6 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
-import android.view.View;
-
 import androidx.test.filters.LargeTest;
 import androidx.test.runner.AndroidJUnit4;
 
@@ -33,6 +31,7 @@
 import com.android.launcher3.ui.AbstractLauncherUiTest;
 import com.android.launcher3.ui.TaplTestsLauncher3;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -53,22 +52,24 @@
     @Before
     public void setUp() throws Exception {
         super.setUp();
+        mLauncher.useTest2WorkspaceLayoutOnReload();
         TaplTestsLauncher3.initialize(this);
 
         assumeTrue(mLauncher.isTwoPanels());
 
-        // Removing the Gmail widget so there are space in the right panel to run the test.
-        Workspace workspace = mLauncher.getWorkspace();
-        workspace.deleteWidget(workspace.tryGetWidget("Gmail", DEFAULT_UI_TIMEOUT));
-
         // Pre verifying the screens
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "Photos", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store", "Maps");
+            assertPageEmpty(launcher, 1);
         });
     }
 
+    @After
+    public void tearDown() {
+        mLauncher.useDefaultWorkspaceLayoutOnReload();
+    }
+
     @Test
     @PortraitLandscape
     public void testDragIconToRightPanel() {
@@ -78,8 +79,8 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "Photos", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather", "Chrome");
+            assertItemsOnPage(launcher, 0, "Maps", "Play Store");
+            assertItemsOnPage(launcher, 1, "Chrome");
         });
     }
 
@@ -92,39 +93,39 @@
 
         workspace.flingBackward();
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 3);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 3);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
             assertItemsOnPage(launcher, 2, "Chrome");
-            assertItemsOnPage(launcher, 3, "Photos");
+            assertItemsOnPage(launcher, 3, "Maps");
         });
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 3);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 3);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3, 4, 5);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
             assertItemsOnPage(launcher, 2, "Chrome");
             assertPageEmpty(launcher, 3);
             assertPageEmpty(launcher, 4);
-            assertItemsOnPage(launcher, 5, "Photos");
+            assertItemsOnPage(launcher, 5, "Maps");
         });
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), -1);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), -1);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
             assertItemsOnPage(launcher, 2, "Chrome");
-            assertItemsOnPage(launcher, 3, "Photos");
+            assertItemsOnPage(launcher, 3, "Maps");
         });
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), -1);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), -1);
 
         workspace.flingForward();
 
@@ -132,8 +133,8 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1);
-            assertItemsOnPage(launcher, 0, "Chrome", "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather", "Photos");
+            assertItemsOnPage(launcher, 0, "Chrome", "Play Store");
+            assertItemsOnPage(launcher, 1, "Maps");
         });
     }
 
@@ -142,13 +143,13 @@
     public void testDragIconToPage2() {
         Workspace workspace = mLauncher.getWorkspace();
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 2);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 2);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
-            assertItemsOnPage(launcher, 2, "Photos");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
+            assertItemsOnPage(launcher, 2, "Maps");
             assertPageEmpty(launcher, 3);
         });
     }
@@ -162,8 +163,8 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "Photos", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store", "Maps");
+            assertPageEmpty(launcher, 1);
             assertPageEmpty(launcher, 2);
             assertItemsOnPage(launcher, 3, "Phone");
         });
@@ -178,16 +179,16 @@
 
         workspace.flingBackward();
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 5);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 5);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3, 4, 5);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
             assertItemsOnPage(launcher, 2, "Messages");
             assertPageEmpty(launcher, 3);
             assertPageEmpty(launcher, 4);
-            assertItemsOnPage(launcher, 5, "Photos");
+            assertItemsOnPage(launcher, 5, "Maps");
         });
 
         workspace.flingBackward();
@@ -196,10 +197,10 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 4, 5, 6, 7);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
             assertPageEmpty(launcher, 4);
-            assertItemsOnPage(launcher, 5, "Photos");
+            assertItemsOnPage(launcher, 5, "Maps");
             assertItemsOnPage(launcher, 6, "Messages");
             assertPageEmpty(launcher, 7);
         });
@@ -208,10 +209,10 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 4, 5);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather", "Messages");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertItemsOnPage(launcher, 1, "Messages");
             assertPageEmpty(launcher, 4);
-            assertItemsOnPage(launcher, 5, "Photos");
+            assertItemsOnPage(launcher, 5, "Maps");
         });
     }
 
@@ -220,23 +221,23 @@
     public void testEmptyPageDoesNotGetRemovedIfPagePairIsNotEmpty() {
         Workspace workspace = mLauncher.getWorkspace();
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 3);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 3);
         workspace.dragIcon(workspace.getHotseatAppIcon("Chrome"), 0);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
             assertItemsOnPage(launcher, 2, "Chrome");
-            assertItemsOnPage(launcher, 3, "Photos");
+            assertItemsOnPage(launcher, 3, "Maps");
         });
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), -1);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), -1);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather", "Photos");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertItemsOnPage(launcher, 1, "Maps");
             assertItemsOnPage(launcher, 2, "Chrome");
             assertPageEmpty(launcher, 3);
         });
@@ -248,8 +249,8 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather", "Photos");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertItemsOnPage(launcher, 1, "Maps");
             assertPageEmpty(launcher, 2);
             assertItemsOnPage(launcher, 3, "Chrome");
         });
@@ -265,8 +266,8 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3);
-            assertItemsOnPage(launcher, 0, "Gmail", "Photos", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
+            assertItemsOnPage(launcher, 0, "Maps");
+            assertPageEmpty(launcher, 1);
             assertItemsOnPage(launcher, 2, "Play Store");
             assertItemsOnPage(launcher, 3, "Chrome");
         });
@@ -277,8 +278,8 @@
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "Photos", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather", "Chrome");
+            assertItemsOnPage(launcher, 0, "Play Store", "Maps");
+            assertItemsOnPage(launcher, 1, "Chrome");
         });
     }
 
@@ -287,27 +288,27 @@
     public void testMiddleEmptyPagesGetRemoved() {
         Workspace workspace = mLauncher.getWorkspace();
 
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 2);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 2);
         workspace.dragIcon(workspace.getHotseatAppIcon("Messages"), 3);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 2, 3, 4, 5);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
-            assertItemsOnPage(launcher, 2, "Photos");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
+            assertItemsOnPage(launcher, 2, "Maps");
             assertPageEmpty(launcher, 3);
             assertPageEmpty(launcher, 4);
             assertItemsOnPage(launcher, 5, "Messages");
         });
 
         workspace.flingBackward();
-        workspace.dragIcon(workspace.getWorkspaceAppIcon("Photos"), 2);
+        workspace.dragIcon(workspace.getWorkspaceAppIcon("Maps"), 2);
 
         executeOnLauncher(launcher -> {
             assertPagesExist(launcher, 0, 1, 4, 5);
-            assertItemsOnPage(launcher, 0, "Play Store", "Gmail", "YouTube");
-            assertItemsOnPage(launcher, 1, "Weather");
-            assertItemsOnPage(launcher, 4, "Photos");
+            assertItemsOnPage(launcher, 0, "Play Store");
+            assertPageEmpty(launcher, 1);
+            assertItemsOnPage(launcher, 4, "Maps");
             assertItemsOnPage(launcher, 5, "Messages");
         });
     }
@@ -335,21 +336,14 @@
         CellLayout page = launcher.getWorkspace().getScreenWithId(pageId);
         int itemCount = page.getShortcutsAndWidgets().getChildCount();
         for (int i = 0; i < itemCount; i++) {
-            CharSequence title = null;
-            View child = page.getShortcutsAndWidgets().getChildAt(i);
-            ItemInfo itemInfo = (ItemInfo) child.getTag();
+            ItemInfo itemInfo = (ItemInfo) page.getShortcutsAndWidgets().getChildAt(i).getTag();
             if (itemInfo != null) {
-                title = itemInfo.title;
-            }
-            if (title == null) {
-                title = child.getContentDescription();
-            }
-            if (title != null) {
-                assertTrue("There was an extra item on page " + pageId + ": " + title,
-                        itemTitleSet.remove(title));
+                assertTrue("There was an extra item on page " + pageId + ": " + itemInfo.title,
+                        itemTitleSet.remove(itemInfo.title));
             }
         }
         assertTrue("Could NOT find some of the items on page " + pageId + ": "
-                        + String.join(",", itemTitleSet), itemTitleSet.isEmpty());
+                        + itemTitleSet.stream().collect(Collectors.joining(",")),
+                itemTitleSet.isEmpty());
     }
-}
+}
\ No newline at end of file
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index fcff3fa..302fabd 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -1848,6 +1848,14 @@
         getTestInfo(TestProtocol.REQUEST_USE_TEST_WORKSPACE_LAYOUT);
     }
 
+    /**
+     * Reloads the workspace with a test layout that includes Maps/Play on workspace, and
+     * Dialer/Messaging/Chrome/Camera on hotseat.
+     */
+    public void useTest2WorkspaceLayoutOnReload() {
+        getTestInfo(TestProtocol.REQUEST_USE_TEST2_WORKSPACE_LAYOUT);
+    }
+
     /** Reloads the workspace with the default layout defined by the user's grid size selection. */
     public void useDefaultWorkspaceLayoutOnReload() {
         getTestInfo(TestProtocol.REQUEST_USE_DEFAULT_WORKSPACE_LAYOUT);
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 7ed5788..b2a2937 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -334,28 +334,14 @@
      * @return validated workspace after the existing appIcon being deleted.
      */
     public Workspace deleteAppIcon(HomeAppIcon homeAppIcon) {
-        return deleteLaunchable(homeAppIcon, LONG_CLICK_EVENT);
-    }
-
-    /**
-     * Delete the widget from the workspace.
-     *
-     * @param widget to be deleted.
-     * @return validated workspace after the existing widget being deleted.
-     */
-    public Workspace deleteWidget(Widget widget) {
-        return deleteLaunchable(widget, Widget.LONG_CLICK_EVENT);
-    }
-
-    private Workspace deleteLaunchable(Launchable launchable, Pattern longClickEvent) {
         try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
              LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                      "removing app icon from workspace")) {
             dragIconToWorkspace(
                     mLauncher,
-                    launchable,
+                    homeAppIcon,
                     () -> getDropPointFromDropTargetBar(mLauncher, DELETE_TARGET_TEXT_ID),
-                    () -> mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, longClickEvent),
+                    () -> mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, LONG_CLICK_EVENT),
                     /* expectDropEvents= */ null);
 
             try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(