diff --git a/quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java b/quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
index 1386ac0..f82fbcc 100644
--- a/quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
+++ b/quickstep/robolectric_tests/src/com/android/launcher3/model/WidgetsPredicationUpdateTaskTest.java
@@ -34,7 +34,6 @@
 import android.os.Process;
 import android.os.UserHandle;
 
-import com.android.launcher3.InvariantDeviceProfile;
 import com.android.launcher3.LauncherAppState;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.icons.ComponentWithLabel;
@@ -42,7 +41,6 @@
 import com.android.launcher3.model.BgDataModel.FixedContainerItems;
 import com.android.launcher3.model.QuickstepModelDelegate.PredictorState;
 import com.android.launcher3.shadows.ShadowDeviceFlag;
-import com.android.launcher3.util.IntSet;
 import com.android.launcher3.util.LauncherModelHelper;
 import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
 import com.android.launcher3.widget.PendingAddWidgetInfo;
@@ -76,7 +74,6 @@
     private Context mContext;
     private LauncherModelHelper mModelHelper;
     private UserHandle mUserHandle;
-    private InvariantDeviceProfile mTestProfile;
 
     @Mock
     private IconCache mIconCache;
@@ -92,7 +89,6 @@
         mContext = RuntimeEnvironment.application;
         mModelHelper = new LauncherModelHelper();
         mUserHandle = Process.myUserHandle();
-        mTestProfile = new InvariantDeviceProfile();
         // 2 widgets, app4/provider1 & app5/provider1, have already been added to the workspace.
         mModelHelper.initializeData("/widgets_predication_update_task_data.txt");
 
@@ -226,10 +222,5 @@
         public void bindExtraContainerItems(FixedContainerItems item) {
             mRecommendedWidgets = item;
         }
-
-        @Override
-        public IntSet getPagesToBindSynchronously() {
-            return IntSet.wrap(0);
-        }
     }
 }
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index b038c7b..e55f1d1 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -583,8 +583,7 @@
                 } else {
                     mUncheckedConsumer = InputConsumer.NO_OP;
                 }
-            } else if (mDeviceState.canTriggerOneHandedAction(event)
-                    && !mDeviceState.isOneHandedModeActive()) {
+            } else if (mDeviceState.canTriggerOneHandedAction(event)) {
                 // Consume gesture event for triggering one handed feature.
                 mUncheckedConsumer = new OneHandedModeInputConsumer(this, mDeviceState,
                         InputConsumer.NO_OP, mInputMonitorCompat);
diff --git a/robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java b/robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
index 07351fe..4319355 100644
--- a/robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
+++ b/robolectric_tests/src/com/android/launcher3/model/ModelMultiCallbacksTest.java
@@ -31,6 +31,7 @@
 import com.android.launcher3.model.data.ItemInfo;
 import com.android.launcher3.shadows.ShadowLooperExecutor;
 import com.android.launcher3.util.Executors;
+import com.android.launcher3.util.IntArray;
 import com.android.launcher3.util.IntSet;
 import com.android.launcher3.util.LauncherLayoutBuilder;
 import com.android.launcher3.util.LauncherModelHelper;
@@ -202,7 +203,7 @@
         }
 
         @Override
-        public IntSet getPagesToBindSynchronously() {
+        public IntSet getPagesToBindSynchronously(IntArray orderedScreenIds) {
             return mPageToBindSync;
         }
 
diff --git a/robolectric_tests/src/com/android/launcher3/util/LauncherPageRestoreHelperTest.java b/robolectric_tests/src/com/android/launcher3/util/LauncherPageRestoreHelperTest.java
deleted file mode 100644
index 51f5851..0000000
--- a/robolectric_tests/src/com/android/launcher3/util/LauncherPageRestoreHelperTest.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.util;
-
-import android.os.Bundle;
-
-import com.android.launcher3.LauncherPageRestoreHelper;
-import com.android.launcher3.Workspace;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.Mockito.when;
-
-@RunWith(RobolectricTestRunner.class)
-public class LauncherPageRestoreHelperTest {
-
-    // Type: int
-    private static final String RUNTIME_STATE_CURRENT_SCREEN = "launcher.current_screen";
-    // Type: int
-    private static final String RUNTIME_STATE_CURRENT_SCREEN_COUNT =
-            "launcher.current_screen_count";
-
-    private LauncherPageRestoreHelper mPageRestoreHelper;
-    private Bundle mState;
-
-    @Mock
-    private Workspace mWorkspace;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mPageRestoreHelper = new LauncherPageRestoreHelper(mWorkspace);
-        mState = new Bundle();
-    }
-
-    @Test
-    public void givenNoChildrenInWorkspace_whenSavePages_thenNothingSaved() {
-        when(mWorkspace.getChildCount()).thenReturn(0);
-
-        mPageRestoreHelper.savePagesToRestore(mState);
-
-        assertFalse(mState.containsKey(RUNTIME_STATE_CURRENT_SCREEN_COUNT));
-        assertFalse(mState.containsKey(RUNTIME_STATE_CURRENT_SCREEN));
-    }
-
-    @Test
-    public void givenMultipleCurrentPages_whenSavePages_thenSavedCorrectly() {
-        when(mWorkspace.getChildCount()).thenReturn(5);
-        when(mWorkspace.getCurrentPage()).thenReturn(2);
-        givenPanelCount(2);
-
-        mPageRestoreHelper.savePagesToRestore(mState);
-
-        assertEquals(5, mState.getInt(RUNTIME_STATE_CURRENT_SCREEN_COUNT));
-        assertEquals(2, mState.getInt(RUNTIME_STATE_CURRENT_SCREEN));
-    }
-
-    @Test
-    public void givenNullSavedState_whenRestorePages_thenReturnEmptyIntSet() {
-        IntSet result = mPageRestoreHelper.getPagesToRestore(null);
-
-        assertTrue(result.isEmpty());
-    }
-
-    @Test
-    public void givenTotalPageCountMissing_whenRestorePages_thenReturnEmptyIntSet() {
-        givenSavedCurrentPage(1);
-        givenPanelCount(1);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertTrue(result.isEmpty());
-    }
-
-    @Test
-    public void givenCurrentPageMissing_whenRestorePages_thenReturnEmptyIntSet() {
-        givenSavedPageCount(3);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertTrue(result.isEmpty());
-    }
-
-    @Test
-    public void givenOnePanel_whenRestorePages_thenReturnThatPage() {
-        givenSavedCurrentPage(2);
-        givenSavedPageCount(5);
-        givenPanelCount(1);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(1, result.size());
-        assertEquals(2, result.getArray().get(0));
-    }
-
-    @Test
-    public void givenTwoPanelOnFirstPages_whenRestorePages_thenReturnThosePages() {
-        givenSavedCurrentPage(0, 1);
-        givenSavedPageCount(2);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(0, 1), result);
-    }
-
-    @Test
-    public void givenTwoPanelOnMiddlePages_whenRestorePages_thenReturnThosePages() {
-        givenSavedCurrentPage(2, 3);
-        givenSavedPageCount(5);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(2, 3), result);
-    }
-
-    @Test
-    public void givenTwoPanelOnLastPage_whenRestorePages_thenReturnOnlyLastPage() {
-        // The device has two panel home but the current page is the last page, so we don't have
-        // a right panel, only the left one.
-        givenSavedCurrentPage(2);
-        givenSavedPageCount(3);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(2), result);
-    }
-
-    @Test
-    public void givenOnlyOnePageAndPhoneFolding_whenRestorePages_thenReturnOnlyOnePage() {
-        givenSavedCurrentPage(0);
-        givenSavedPageCount(1);
-        givenPanelCount(1);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(0), result);
-    }
-
-    @Test
-    public void givenPhoneFolding_whenRestorePages_thenReturnOnlyTheFirstCurrentPage() {
-        givenSavedCurrentPage(2, 3);
-        givenSavedPageCount(4);
-        givenPanelCount(1);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(2), result);
-    }
-
-    @Test
-    public void givenPhoneUnfolding_whenRestorePages_thenReturnCurrentPagePlusTheNextOne() {
-        givenSavedCurrentPage(2);
-        givenSavedPageCount(4);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(2, 3), result);
-    }
-
-    @Test
-    public void givenPhoneUnfoldingOnLastPage_whenRestorePages_thenReturnOnlyLastPage() {
-        givenSavedCurrentPage(4);
-        givenSavedPageCount(5);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(4), result);
-    }
-
-    @Test
-    public void givenOnlyOnePageAndPhoneUnfolding_whenRestorePages_thenReturnOnlyOnePage() {
-        givenSavedCurrentPage(0);
-        givenSavedPageCount(1);
-        givenPanelCount(2);
-
-        IntSet result = mPageRestoreHelper.getPagesToRestore(mState);
-
-        assertEquals(IntSet.wrap(0), result);
-    }
-
-    private void givenPanelCount(int panelCount) {
-        when(mWorkspace.getPanelCount()).thenReturn(panelCount);
-        when(mWorkspace.getLeftmostVisiblePageForIndex(anyInt())).thenAnswer(invocation -> {
-            int pageIndex = invocation.getArgument(0);
-            return pageIndex * panelCount / panelCount;
-        });
-    }
-
-    private void givenSavedPageCount(int pageCount) {
-        mState.putInt(RUNTIME_STATE_CURRENT_SCREEN_COUNT, pageCount);
-    }
-
-    private void givenSavedCurrentPage(int... pages) {
-        mState.putInt(RUNTIME_STATE_CURRENT_SCREEN, pages[0]);
-    }
-}
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index ba55834..477964a 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -25,6 +25,7 @@
 import android.util.AttributeSet;
 import android.view.View;
 
+import com.android.launcher3.LauncherSettings.Favorites;
 import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
 import com.android.launcher3.dragndrop.DragOptions;
 import com.android.launcher3.logging.StatsLogManager;
@@ -128,11 +129,21 @@
     public void completeDrop(DragObject d) {
         ItemInfo item = d.dragInfo;
         if (canRemove(item)) {
-            int itemPage = mLauncher.getWorkspace().getCurrentPage();
+            ItemInfo pageItem = item;
+            if (item.container <= 0) {
+                View v = mLauncher.getWorkspace().getHomescreenIconByItemId(item.container);
+                if (v != null) {
+                    pageItem = (ItemInfo) v.getTag();
+                }
+            }
+            IntSet pageIds = pageItem.container == Favorites.CONTAINER_DESKTOP
+                    ? IntSet.wrap(pageItem.screenId)
+                    : mLauncher.getWorkspace().getCurrentPageScreenIds();
+
             onAccessibilityDrop(null, item);
             ModelWriter modelWriter = mLauncher.getModelWriter();
             Runnable onUndoClicked = () -> {
-                mLauncher.setPagesToBindSynchronously(IntSet.wrap(itemPage));
+                mLauncher.setPagesToBindSynchronously(pageIds);
                 modelWriter.abortDelete();
                 mLauncher.getStatsLogManager().logger().log(LAUNCHER_UNDO);
             };
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index edd44e3..222c7d6 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -22,6 +22,7 @@
 import static com.android.launcher3.ResourceUtils.pxFromDp;
 import static com.android.launcher3.Utilities.dpiFromPx;
 import static com.android.launcher3.Utilities.pxFromSp;
+import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
 import static com.android.launcher3.util.WindowManagerCompat.MIN_TABLET_WIDTH;
 
 import android.annotation.SuppressLint;
@@ -399,7 +400,8 @@
     }
 
     private void updateHotseatIconSize(int hotseatIconSizePx) {
-        hotseatCellHeightPx = hotseatIconSizePx;
+        // Ensure there is enough space for folder icons, which have a slightly larger radius.
+        hotseatCellHeightPx = (int) Math.ceil(hotseatIconSizePx * ICON_OVERLAP_FACTOR);
         if (isVerticalBarLayout()) {
             hotseatBarSizePx = hotseatIconSizePx + hotseatBarSidePaddingStartPx
                     + hotseatBarSidePaddingEndPx;
@@ -478,7 +480,7 @@
         if (workspaceCellPaddingY < iconTextHeight) {
             iconTextSizePx = 0;
             iconDrawablePaddingPx = 0;
-            cellHeightPx = iconSizePx;
+            cellHeightPx = (int) Math.ceil(iconSizePx * ICON_OVERLAP_FACTOR);
             autoResizeAllAppsCells();
         }
     }
@@ -565,7 +567,8 @@
             desiredWorkspaceLeftRightMarginPx = (int) (desiredWorkspaceLeftRightOriginalPx * scale);
         } else {
             cellWidthPx = iconSizePx + iconDrawablePaddingPx;
-            cellHeightPx = iconSizePx + iconDrawablePaddingPx
+            cellHeightPx = (int) Math.ceil(iconSizePx * ICON_OVERLAP_FACTOR)
+                    + iconDrawablePaddingPx
                     + Utilities.calculateTextHeight(iconTextSizePx);
             int cellPaddingY = (getCellSize().y - cellHeightPx) / 2;
             if (iconDrawablePaddingPx > cellPaddingY && !isVerticalLayout
@@ -824,9 +827,9 @@
                 ? workspacePadding.bottom
                 : hotseatBarSizePx - hotseatCellHeightPx - hotseatQsbHeight;
 
-        if (isScalableGrid && qsbBottomMarginPx <= freeSpace) {
-            return qsbBottomMarginPx;
-        } else {
+        if (isScalableGrid) {
+            return Math.min(qsbBottomMarginPx, freeSpace);
+        }  else {
             return (int) (freeSpace * QSB_CENTER_FACTOR)
                 + (isTaskbarPresent ? taskbarSize : getInsets().bottom);
         }
@@ -899,14 +902,16 @@
         return isVerticalBarLayout();
     }
 
-    public int getCellHeight(@ContainerType int containerType) {
+    public int getCellContentHeight(@ContainerType int containerType) {
         switch (containerType) {
             case CellLayout.WORKSPACE:
                 return cellHeightPx;
             case CellLayout.FOLDER:
                 return folderCellHeightPx;
             case CellLayout.HOTSEAT:
-                return hotseatCellHeightPx;
+                // The hotseat is the only container where the cell height is going to be
+                // different from the content within that cell.
+                return iconSizePx;
             default:
                 // ??
                 return 0;
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 78a8a97..e736022 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -36,6 +36,7 @@
 import static com.android.launcher3.LauncherState.NO_SCALE;
 import static com.android.launcher3.LauncherState.SPRING_LOADED;
 import static com.android.launcher3.Utilities.postAsyncCallback;
+import static com.android.launcher3.WorkspaceLayoutManager.LEFT_PANEL_ID;
 import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions;
 import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_LAUNCHER_LOAD;
 import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
@@ -259,6 +260,8 @@
     private static final String RUNTIME_STATE_PENDING_ACTIVITY_RESULT = "launcher.activity_result";
     // Type: SparseArray<Parcelable>
     private static final String RUNTIME_STATE_WIDGET_PANEL = "launcher.widget_panel";
+    // Type int[]
+    private static final String RUNTIME_STATE_CURRENT_SCREEN_IDS = "launcher.current_screen_ids";
 
     public static final String ON_CREATE_EVT = "Launcher.onCreate";
     public static final String ON_START_EVT = "Launcher.onStart";
@@ -287,8 +290,6 @@
     private WidgetManagerHelper mAppWidgetManager;
     private LauncherAppWidgetHost mAppWidgetHost;
 
-    private LauncherPageRestoreHelper mPageRestoreHelper;
-
     private final int[] mTmpAddItemCellCoordinates = new int[2];
 
     @Thunk
@@ -325,7 +326,7 @@
     private PopupDataProvider mPopupDataProvider;
 
     private IntSet mSynchronouslyBoundPages = new IntSet();
-    private IntSet mPagesToBindSynchronously = new IntSet();
+    @NonNull private IntSet mPagesToBindSynchronously = new IntSet();
 
     // We only want to get the SharedPreferences once since it does an FS stat each time we get
     // it from the context.
@@ -460,9 +461,11 @@
         restoreState(savedInstanceState);
         mStateManager.reapplyState();
 
-        mPageRestoreHelper = new LauncherPageRestoreHelper(mWorkspace);
         if (savedInstanceState != null) {
-            mPagesToBindSynchronously = mPageRestoreHelper.getPagesToRestore(savedInstanceState);
+            int[] pageIds = savedInstanceState.getIntArray(RUNTIME_STATE_CURRENT_SCREEN_IDS);
+            if (pageIds != null) {
+                mPagesToBindSynchronously = IntSet.wrap(pageIds);
+            }
         }
 
         if (!mModel.addCallbacksAndLoad(this)) {
@@ -1188,7 +1191,6 @@
         // Until the workspace is bound, ensure that we keep the wallpaper offset locked to the
         // default state, otherwise we will update to the wrong offsets in RTL
         mWorkspace.lockWallpaperToDefaultPage();
-        mWorkspace.bindAndInitLeftPanel();
         mWorkspace.bindAndInitFirstWorkspaceScreen(null /* recycled qsb */);
         mDragController.addDragListener(mWorkspace);
 
@@ -1586,14 +1588,19 @@
     public void onRestoreInstanceState(Bundle state) {
         super.onRestoreInstanceState(state);
         if (mSynchronouslyBoundPages != null) {
-            mSynchronouslyBoundPages.forEach(page -> mWorkspace.restoreInstanceStateForChild(page));
+            mSynchronouslyBoundPages.forEach(screenId -> {
+                int pageIndex = mWorkspace.getPageIndexForScreenId(screenId);
+                if (pageIndex != PagedView.INVALID_PAGE) {
+                    mWorkspace.restoreInstanceStateForChild(pageIndex);
+                }
+            });
         }
     }
 
     @Override
     protected void onSaveInstanceState(Bundle outState) {
-        mPageRestoreHelper.savePagesToRestore(outState);
-
+        outState.putIntArray(RUNTIME_STATE_CURRENT_SCREEN_IDS,
+                mWorkspace.getCurrentPageScreenIds().getArray().toArray());
         outState.putInt(RUNTIME_STATE, mStateManager.getState().ordinal);
 
         AbstractFloatingView widgets = AbstractFloatingView
@@ -2081,18 +2088,42 @@
         mPagesToBindSynchronously = pages;
     }
 
-    /**
-     * Implementation of the method from LauncherModel.Callbacks.
-     */
     @Override
-    public IntSet getPagesToBindSynchronously() {
-        if (mPagesToBindSynchronously != null && !mPagesToBindSynchronously.isEmpty()) {
-            return mPagesToBindSynchronously;
-        } else if (mWorkspace != null) {
-            return mWorkspace.getVisiblePageIndices();
+    public IntSet getPagesToBindSynchronously(IntArray orderedScreenIds) {
+        IntSet visibleIds = mPagesToBindSynchronously.isEmpty()
+                ? mWorkspace.getCurrentPageScreenIds() : mPagesToBindSynchronously;
+        IntArray actualIds = new IntArray();
+
+        if (mDeviceProfile.isTwoPanels) {
+            actualIds.add(LEFT_PANEL_ID);
         } else {
-            return new IntSet();
+            visibleIds.remove(LEFT_PANEL_ID);
         }
+        IntSet result = new IntSet();
+        if (visibleIds.isEmpty()) {
+            return result;
+        }
+        for (int id : orderedScreenIds.toArray()) {
+            if (id != LEFT_PANEL_ID) {
+                actualIds.add(id);
+            }
+        }
+        int firstId = visibleIds.getArray().get(0);
+        if (actualIds.contains(firstId)) {
+            result.add(firstId);
+
+            if (mDeviceProfile.isTwoPanels) {
+                int index = actualIds.indexOf(firstId);
+                int nextIndex = ((int) (index / 2)) * 2;
+                if (nextIndex == index) {
+                    nextIndex++;
+                }
+                if (nextIndex < actualIds.size()) {
+                    result.add(actualIds.get(nextIndex));
+                }
+            }
+        }
+        return result;
     }
 
     /**
@@ -2143,7 +2174,7 @@
         // Make sure the first screen is at the start if there's no widget panel,
         // or on the second place if the first is the widget panel
         boolean isLeftPanelShown =
-                mWorkspace.mWorkspaceScreens.containsKey(Workspace.LEFT_PANEL_ID);
+                mWorkspace.mWorkspaceScreens.containsKey(LEFT_PANEL_ID);
         int firstScreenPosition = isLeftPanelShown && orderedScreenIds.size() > 1 ? 1 : 0;
 
         if (FeatureFlags.QSB_ON_FIRST_SCREEN &&
@@ -2171,7 +2202,7 @@
                 continue;
             }
 
-            if (screenId == Workspace.LEFT_PANEL_ID) {
+            if (screenId == LEFT_PANEL_ID) {
                 // No need to bind the left panel, as its always bound.
                 continue;
             }
@@ -2252,7 +2283,7 @@
             }
 
             // Skip if the item is on the left widget panel but the panel is not shown
-            if (item.screenId == Workspace.LEFT_PANEL_ID && !getDeviceProfile().isTwoPanels) {
+            if (item.screenId == LEFT_PANEL_ID && !getDeviceProfile().isTwoPanels) {
                 continue;
             }
 
@@ -2555,9 +2586,6 @@
     @Override
     public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
         mSynchronouslyBoundPages = boundPages;
-        if (!boundPages.isEmpty()) {
-            mWorkspace.setCurrentPage(boundPages.getArray().get(0));
-        }
         mPagesToBindSynchronously = new IntSet();
 
         clearPendingBinds();
@@ -2598,7 +2626,8 @@
         }
 
         int currentPage = pagesBoundFirst != null && !pagesBoundFirst.isEmpty()
-                ? pagesBoundFirst.getArray().get(0) : PagedView.INVALID_PAGE;
+                ? mWorkspace.getPageIndexForScreenId(pagesBoundFirst.getArray().get(0))
+                : PagedView.INVALID_PAGE;
         // When undoing the removal of the last item on a page, return to that page.
         // Since we are just resetting the current page without user interaction,
         // override the previous page so we don't log the page switch.
diff --git a/src/com/android/launcher3/LauncherPageRestoreHelper.java b/src/com/android/launcher3/LauncherPageRestoreHelper.java
deleted file mode 100644
index e679a12..0000000
--- a/src/com/android/launcher3/LauncherPageRestoreHelper.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3;
-
-import android.os.Bundle;
-import android.util.Log;
-
-import androidx.annotation.VisibleForTesting;
-
-import com.android.launcher3.util.IntSet;
-
-import static androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE;
-
-/**
- * There's a logic which prioritizes the binding for the current page and defers the other pages'
- * binding. If two panel home is enabled, we want to bind both pages together.
- * LauncherPageRestoreHelper's purpose is to contain the logic for persisting, restoring and
- * calculating which pages to load immediately.
- */
-public class LauncherPageRestoreHelper {
-
-    public static final String TAG = "LauncherPageRestoreHelper";
-
-    // Type: int
-    private static final String RUNTIME_STATE_CURRENT_SCREEN = "launcher.current_screen";
-    // Type: int
-    private static final String RUNTIME_STATE_CURRENT_SCREEN_COUNT =
-            "launcher.current_screen_count";
-
-    private Workspace mWorkspace;
-
-    public LauncherPageRestoreHelper(Workspace workspace) {
-        this.mWorkspace = workspace;
-    }
-
-    /**
-     * Some configuration changes trigger Launcher to recreate itself, and we want to give more
-     * priority to the currently active pages in the restoration process.
-     */
-    @VisibleForTesting(otherwise = PACKAGE_PRIVATE)
-    public IntSet getPagesToRestore(Bundle savedInstanceState) {
-        IntSet pagesToRestore = new IntSet();
-
-        if (savedInstanceState == null) {
-            return pagesToRestore;
-        }
-
-        int currentPage = savedInstanceState.getInt(RUNTIME_STATE_CURRENT_SCREEN, -1);
-        int totalPageCount = savedInstanceState.getInt(RUNTIME_STATE_CURRENT_SCREEN_COUNT, -1);
-        int panelCount = mWorkspace.getPanelCount();
-
-        if (totalPageCount <= 0 || currentPage < 0) {
-            Log.e(TAG, "getPagesToRestore: Invalid input: " + totalPageCount + ", " + currentPage);
-            return pagesToRestore;
-        }
-
-        int newCurrentPage = mWorkspace.getLeftmostVisiblePageForIndex(currentPage);
-        for (int page = newCurrentPage; page < newCurrentPage + panelCount
-                && page < totalPageCount; page++) {
-            pagesToRestore.add(page);
-        }
-
-        return pagesToRestore;
-    }
-
-    /**
-     * This should be called from Launcher's onSaveInstanceState method to persist everything that
-     * is necessary to calculate later which pages need to be initialized first after a
-     * configuration change.
-     */
-    @VisibleForTesting(otherwise = PACKAGE_PRIVATE)
-    public void savePagesToRestore(Bundle outState) {
-        int pageCount = mWorkspace.getChildCount();
-        if (pageCount > 0) {
-            outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getCurrentPage());
-            outState.putInt(RUNTIME_STATE_CURRENT_SCREEN_COUNT, pageCount);
-        }
-    }
-}
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 440e9e3..a8ed6bc 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -61,7 +61,6 @@
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.logging.FileLog;
 import com.android.launcher3.model.DbDowngradeHelper;
-import com.android.launcher3.model.data.ItemInfo;
 import com.android.launcher3.pm.UserCache;
 import com.android.launcher3.provider.LauncherDbUtils;
 import com.android.launcher3.provider.LauncherDbUtils.SQLiteTransaction;
@@ -1090,7 +1089,7 @@
         }
 
         private int initializeMaxScreenId(SQLiteDatabase db) {
-            return getMaxId(db, "SELECT MAX(%1$s) FROM %2$s WHERE %3$s = %4$d",
+            return getMaxId(db, "SELECT MAX(%1$s) FROM %2$s WHERE %3$s = %4$d AND %1$s >= 0",
                     Favorites.SCREEN, Favorites.TABLE_NAME, Favorites.CONTAINER,
                     Favorites.CONTAINER_DESKTOP);
         }
diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
index dff8534..bebbf4f 100644
--- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java
+++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
@@ -122,7 +122,7 @@
 
     public int getCellContentHeight() {
         return Math.min(getMeasuredHeight(),
-                mActivity.getDeviceProfile().getCellHeight(mContainerType));
+                mActivity.getDeviceProfile().getCellContentHeight(mContainerType));
     }
 
     public void measureChild(View child) {
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 6c0e893..faf2dd2 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -102,6 +102,7 @@
 import com.android.launcher3.util.EdgeEffectCompat;
 import com.android.launcher3.util.Executors;
 import com.android.launcher3.util.IntArray;
+import com.android.launcher3.util.IntSet;
 import com.android.launcher3.util.IntSparseArrayMap;
 import com.android.launcher3.util.ItemInfoMatcher;
 import com.android.launcher3.util.LauncherBindableItemsContainer;
@@ -327,22 +328,6 @@
             setPageSpacing(Math.max(maxInsets, maxPadding));
         }
 
-        if (grid.isTwoPanels) {
-            // Add left widget panel if it isn't already there
-            if (!mWorkspaceScreens.containsKey(LEFT_PANEL_ID)) {
-                int newCurrentPage = mCurrentPage + 1;
-                bindAndInitLeftPanel();
-                setCurrentPage(newCurrentPage);
-            }
-        } else {
-            // Remove left widget panel if it is present
-            if (mWorkspaceScreens.containsKey(LEFT_PANEL_ID)) {
-                int newCurrentPage = mCurrentPage - 1;
-                removeLeftPanel();
-                setCurrentPage(newCurrentPage);
-            }
-        }
-
         int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx;
         int paddingBottom = grid.cellLayoutBottomPaddingPx;
         int twoPanelLandscapeSidePadding = paddingLeftRight * 2;
@@ -570,6 +555,10 @@
         if (!FeatureFlags.QSB_ON_FIRST_SCREEN) {
             return;
         }
+        if (isTwoPanelEnabled()) {
+            insertNewWorkspaceScreen(Workspace.LEFT_PANEL_ID, getChildCount());
+        }
+
         // Add the first page
         CellLayout firstPage = insertNewWorkspaceScreen(Workspace.FIRST_SCREEN_ID, getChildCount());
         // Always add a QSB on the first screen.
@@ -590,19 +579,6 @@
         }
     }
 
-    /**
-     * Initializes and binds the left panel
-     */
-    public void bindAndInitLeftPanel() {
-        if (!FeatureFlags.QSB_ON_FIRST_SCREEN || !isTwoPanelEnabled()
-                || mWorkspaceScreens.containsKey(Workspace.LEFT_PANEL_ID)) {
-            return;
-        }
-
-        insertNewWorkspaceScreen(Workspace.LEFT_PANEL_ID, getChildCount());
-        mLauncher.getModelWriter().setLeftPanelShown(true);
-    }
-
     public void removeAllWorkspaceScreens() {
         // Disable all layout transitions before removing all pages to ensure that we don't get the
         // transition animations competing with us changing the scroll when we add pages
@@ -624,7 +600,6 @@
         mLauncher.mHandler.removeCallbacksAndMessages(DeferredWidgetRefresh.class);
 
         // Ensure that the first page is always present
-        bindAndInitLeftPanel();
         bindAndInitFirstWorkspaceScreen(qsb);
 
         // Re-enable the layout transitions
@@ -645,18 +620,6 @@
         insertNewWorkspaceScreen(screenId, getChildCount());
     }
 
-    private void removeLeftPanel() {
-        if (!mWorkspaceScreens.containsKey(LEFT_PANEL_ID)) {
-            return;
-        }
-        mLauncher.getModelWriter().setLeftPanelShown(false);
-        CellLayout leftPanel = mWorkspaceScreens.get(LEFT_PANEL_ID);
-        mWorkspaceScreens.remove(LEFT_PANEL_ID);
-        removeView(leftPanel);
-        mScreenOrder.removeValue(LEFT_PANEL_ID);
-        updatePageScrollValues();
-    }
-
     public CellLayout insertNewWorkspaceScreen(int screenId, int insertIndex) {
         if (mWorkspaceScreens.containsKey(screenId)) {
             throw new RuntimeException("Screen id " + screenId + " already exists!");
@@ -829,6 +792,10 @@
         return indexOfChild(mWorkspaceScreens.get(screenId));
     }
 
+    public IntSet getCurrentPageScreenIds() {
+        return IntSet.wrap(getScreenIdForPageIndex(getCurrentPage()));
+    }
+
     public int getScreenIdForPageIndex(int index) {
         if (0 <= index && index < mScreenOrder.size()) {
             return mScreenOrder.get(index);
diff --git a/src/com/android/launcher3/dragndrop/FolderAdaptiveIcon.java b/src/com/android/launcher3/dragndrop/FolderAdaptiveIcon.java
index 6a6603c..74d9a22 100644
--- a/src/com/android/launcher3/dragndrop/FolderAdaptiveIcon.java
+++ b/src/com/android/launcher3/dragndrop/FolderAdaptiveIcon.java
@@ -21,11 +21,11 @@
 import android.annotation.TargetApi;
 import android.graphics.Bitmap;
 import android.graphics.Matrix;
+import android.graphics.Paint;
 import android.graphics.Path;
 import android.graphics.Point;
 import android.graphics.Rect;
 import android.graphics.drawable.AdaptiveIconDrawable;
-import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.os.Build;
 import android.util.Log;
@@ -129,10 +129,19 @@
                     canvas.restore();
                 });
 
+        Bitmap bgBitmap = BitmapRenderer.createHardwareBitmap(dragViewSize.x, dragViewSize.y,
+                (canvas) -> {
+                    Paint p = new Paint();
+                    p.setColor(bg.getBgColor());
+
+                    canvas.drawCircle(dragViewSize.x / 2f, dragViewSize.y / 2f, bg.getRadius(), p);
+                });
+
         ShiftedBitmapDrawable badge = new ShiftedBitmapDrawable(badgeBmp, 0, 0);
         ShiftedBitmapDrawable foreground = new ShiftedBitmapDrawable(previewBitmap, 0, 0);
+        ShiftedBitmapDrawable background = new ShiftedBitmapDrawable(bgBitmap, 0, 0);
 
-        return new FolderAdaptiveIcon(new ColorDrawable(bg.getBgColor()), foreground, badge, mask);
+        return new FolderAdaptiveIcon(background, foreground, badge, mask);
     }
 
     @Override
diff --git a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java
index 54967a99..8cd91d3 100644
--- a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java
+++ b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java
@@ -7,7 +7,9 @@
 
     private static final float MIN_SCALE = 0.44f;
     private static final float MAX_SCALE = 0.51f;
-    private static final float MAX_RADIUS_DILATION = 0.1f;
+    private static final float MAX_RADIUS_DILATION = 0.25f;
+    // The max amount of overlap the preview items can go outside of the background bounds.
+    public static final float ICON_OVERLAP_FACTOR = 1 + (MAX_RADIUS_DILATION / 2f);
     private static final float ITEM_RADIUS_SCALE_FACTOR = 1.15f;
 
     public static final int EXIT_INDEX = -2;
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index f005b61..60d8cdb 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -16,6 +16,7 @@
 
 package com.android.launcher3.folder;
 
+import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
 import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW;
 import static com.android.launcher3.folder.PreviewItemManager.INITIAL_ITEM_ANIMATION_DURATION;
 import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELED;
@@ -236,6 +237,8 @@
     public void getPreviewBounds(Rect outBounds) {
         mPreviewItemManager.recomputePreviewDrawingParams();
         mBackground.getBounds(outBounds);
+        // The preview items go outside of the bounds of the background.
+        Utilities.scaleRectAboutCenter(outBounds, ICON_OVERLAP_FACTOR);
     }
 
     public float getBackgroundStrokeWidth() {
diff --git a/src/com/android/launcher3/folder/PreviewBackground.java b/src/com/android/launcher3/folder/PreviewBackground.java
index 460521f..18d0b10 100644
--- a/src/com/android/launcher3/folder/PreviewBackground.java
+++ b/src/com/android/launcher3/folder/PreviewBackground.java
@@ -16,6 +16,7 @@
 
 package com.android.launcher3.folder;
 
+import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
 import static com.android.launcher3.graphics.IconShape.getShape;
 import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
 
@@ -186,7 +187,7 @@
         outBounds.set(left, top, right, bottom);
     }
 
-    int getRadius() {
+    public int getRadius() {
         return previewSize / 2;
     }
 
@@ -348,7 +349,12 @@
 
     public Path getClipPath() {
         mPath.reset();
-        getShape().addToPath(mPath, getOffsetX(), getOffsetY(), getScaledRadius());
+        float radius = getScaledRadius() * ICON_OVERLAP_FACTOR;
+        // Find the difference in radius so that the clip path remains centered.
+        float radiusDifference = radius - getRadius();
+        float offsetX = basePreviewOffsetX - radiusDifference;
+        float offsetY = basePreviewOffsetY - radiusDifference;
+        getShape().addToPath(mPath, offsetX, offsetY, radius);
         return mPath;
     }
 
diff --git a/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java b/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java
index 13c83be..f3087c0 100644
--- a/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java
+++ b/src/com/android/launcher3/graphics/PreviewSurfaceRenderer.java
@@ -175,7 +175,6 @@
                             query);
 
                     MAIN_EXECUTOR.execute(() -> {
-                        mBgDataModel.isLeftPanelShown = deviceProfile.isTwoPanels;
                         renderView(previewContext, mBgDataModel, mWidgetProvidersMap);
                         mOnDestroyCallbacks.add(previewContext::onDestroy);
                     });
diff --git a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
index b2b0010..4f12d0b 100644
--- a/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
+++ b/src/com/android/launcher3/model/AddWorkspaceItemsTask.java
@@ -15,6 +15,9 @@
  */
 package com.android.launcher3.model;
 
+import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID;
+import static com.android.launcher3.WorkspaceLayoutManager.LEFT_PANEL_ID;
+
 import android.content.Intent;
 import android.content.pm.LauncherActivityInfo;
 import android.content.pm.LauncherApps;
@@ -27,6 +30,7 @@
 import com.android.launcher3.LauncherAppState;
 import com.android.launcher3.LauncherModel.CallbackTask;
 import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.logging.FileLog;
 import com.android.launcher3.model.BgDataModel.Callbacks;
 import com.android.launcher3.model.data.AppInfo;
@@ -38,6 +42,7 @@
 import com.android.launcher3.pm.PackageInstallInfo;
 import com.android.launcher3.util.GridOccupancy;
 import com.android.launcher3.util.IntArray;
+import com.android.launcher3.util.IntSet;
 import com.android.launcher3.util.PackageManagerHelper;
 
 import java.util.ArrayList;
@@ -291,11 +296,15 @@
         boolean found = false;
 
         int screenCount = workspaceScreens.size();
-        int firstScreenToCheck = dataModel.isLeftPanelShown ? 2 : 1;
-        // Search on the screens for empty space
-        for (int screen = firstScreenToCheck; screen < screenCount; screen++) {
+        // First check the preferred screen.
+        IntSet screensToExclude = IntSet.wrap(LEFT_PANEL_ID);
+        if (FeatureFlags.QSB_ON_FIRST_SCREEN) {
+            screensToExclude.add(FIRST_SCREEN_ID);
+        }
+
+        for (int screen = 0; screen < screenCount; screen++) {
             screenId = workspaceScreens.get(screen);
-            if (findNextAvailableIconSpaceInScreen(
+            if (!screensToExclude.contains(screenId) && findNextAvailableIconSpaceInScreen(
                     app, screenItems.get(screenId), coordinates, spanX, spanY)) {
                 // We found a space for it
                 found = true;
diff --git a/src/com/android/launcher3/model/BaseLoaderResults.java b/src/com/android/launcher3/model/BaseLoaderResults.java
index c202d8d..0e132c2 100644
--- a/src/com/android/launcher3/model/BaseLoaderResults.java
+++ b/src/com/android/launcher3/model/BaseLoaderResults.java
@@ -165,25 +165,7 @@
         }
 
         private void bind() {
-            IntSet currentScreenIndices;
-            {
-                // Create an anonymous scope to calculate currentScreen as it has to be a
-                // final variable.
-                IntSet screenIndices = mCallbacks.getPagesToBindSynchronously();
-                if (screenIndices == null || screenIndices.isEmpty()
-                        || screenIndices.getArray().get(screenIndices.size() - 1)
-                        >= mOrderedScreenIds.size()) {
-                    // There maybe no workspace screens (just hotseat items and an empty page).
-                    // Also we want to prevent IndexOutOfBoundsExceptions.
-                    screenIndices = new IntSet();
-                }
-                currentScreenIndices = screenIndices;
-            }
-
-
-            IntSet currentScreenIds  = new IntSet();
-            currentScreenIndices.forEach(
-                    index -> currentScreenIds.add(mOrderedScreenIds.get(index)));
+            IntSet currentScreenIds = mCallbacks.getPagesToBindSynchronously(mOrderedScreenIds);
 
             // Separate the items that are on the current screen, and all the other remaining items
             ArrayList<ItemInfo> currentWorkspaceItems = new ArrayList<>();
@@ -218,7 +200,7 @@
             Executor pendingExecutor = pendingTasks::add;
             bindWorkspaceItems(otherWorkspaceItems, pendingExecutor);
             bindAppWidgets(otherAppWidgets, pendingExecutor);
-            executeCallbacksTask(c -> c.finishBindingItems(currentScreenIndices), pendingExecutor);
+            executeCallbacksTask(c -> c.finishBindingItems(currentScreenIds), pendingExecutor);
             pendingExecutor.execute(
                     () -> {
                         MODEL_EXECUTOR.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
@@ -229,7 +211,7 @@
             executeCallbacksTask(
                     c -> {
                         MODEL_EXECUTOR.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
-                        c.onInitialBindComplete(currentScreenIndices, pendingTasks);
+                        c.onInitialBindComplete(currentScreenIds, pendingTasks);
                     }, mUiExecutor);
         }
 
diff --git a/src/com/android/launcher3/model/BgDataModel.java b/src/com/android/launcher3/model/BgDataModel.java
index dd4c3c3..13ad90e 100644
--- a/src/com/android/launcher3/model/BgDataModel.java
+++ b/src/com/android/launcher3/model/BgDataModel.java
@@ -117,11 +117,6 @@
     public int lastBindId = 0;
 
     /**
-     * Value that indicates if left widget panel is shown or not.
-     */
-    public boolean isLeftPanelShown = false;
-
-    /**
      * Clears all the data
      */
     public synchronized void clear() {
@@ -146,14 +141,6 @@
         if (FeatureFlags.QSB_ON_FIRST_SCREEN || screenSet.isEmpty()) {
             screenSet.add(Workspace.FIRST_SCREEN_ID);
         }
-
-        if (isLeftPanelShown) {
-            // We should add it even though there are no items on it.
-            screenSet.add(Workspace.LEFT_PANEL_ID);
-        } else {
-            // We should NOT add it even though there are items on it.
-            screenSet.remove(Workspace.LEFT_PANEL_ID);
-        }
         return screenSet.getArray();
     }
 
@@ -459,10 +446,11 @@
         int FLAG_QUIET_MODE_CHANGE_PERMISSION = 1 << 2;
 
         /**
-         * Returns an IntSet of page numbers to bind first, synchronously if possible
+         * Returns an IntSet of page ids to bind first, synchronously if possible
          * or an empty IntSet
+         * @param orderedScreenIds All the page ids to be bound
          */
-        default IntSet getPagesToBindSynchronously() {
+        default IntSet getPagesToBindSynchronously(IntArray orderedScreenIds) {
             return new IntSet();
         }
 
diff --git a/src/com/android/launcher3/model/LoaderTask.java b/src/com/android/launcher3/model/LoaderTask.java
index 31ca6e7..43f9be5 100644
--- a/src/com/android/launcher3/model/LoaderTask.java
+++ b/src/com/android/launcher3/model/LoaderTask.java
@@ -16,6 +16,7 @@
 
 package com.android.launcher3.model;
 
+import static com.android.launcher3.WorkspaceLayoutManager.LEFT_PANEL_ID;
 import static com.android.launcher3.config.FeatureFlags.MULTI_DB_GRID_MIRATION_ALGO;
 import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_HAS_SHORTCUT_PERMISSION;
 import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_CHANGE_PERMISSION;
@@ -86,6 +87,7 @@
 import com.android.launcher3.shortcuts.ShortcutRequest.QueryResult;
 import com.android.launcher3.util.ComponentKey;
 import com.android.launcher3.util.IOUtils;
+import com.android.launcher3.util.IntArray;
 import com.android.launcher3.util.IntSet;
 import com.android.launcher3.util.LooperIdleLock;
 import com.android.launcher3.util.PackageManagerHelper;
@@ -175,11 +177,17 @@
     private void sendFirstScreenActiveInstallsBroadcast() {
         ArrayList<ItemInfo> firstScreenItems = new ArrayList<>();
         ArrayList<ItemInfo> allItems = mBgDataModel.getAllWorkspaceItems();
-        // Screen set is never empty
-        final int firstScreen = mBgDataModel.collectWorkspaceScreens().get(0);
-        // TODO(b/185515153): support two panel home.
 
-        filterCurrentWorkspaceItems(IntSet.wrap(firstScreen), allItems, firstScreenItems,
+        // Screen set is never empty
+        IntArray allScreens = mBgDataModel.collectWorkspaceScreens();
+        final int firstScreen = allScreens.get(0);
+
+        IntSet firstScreens = IntSet.wrap(firstScreen);
+        if (firstScreen == LEFT_PANEL_ID && allScreens.size() >= 2) {
+            firstScreens.add(allScreens.get(1));
+        }
+
+        filterCurrentWorkspaceItems(firstScreens, allItems, firstScreenItems,
                 new ArrayList<>() /* otherScreenItems are ignored */);
         mFirstScreenBroadcast.sendBroadcasts(mApp.getContext(), firstScreenItems);
     }
diff --git a/src/com/android/launcher3/model/ModelWriter.java b/src/com/android/launcher3/model/ModelWriter.java
index 55edfd4..0439e75 100644
--- a/src/com/android/launcher3/model/ModelWriter.java
+++ b/src/com/android/launcher3/model/ModelWriter.java
@@ -121,13 +121,6 @@
         }
     }
 
-    /**
-     * Sets the value that indicates if left widget panel is shown or not.
-     */
-    public void setLeftPanelShown(boolean value) {
-        mBgDataModel.isLeftPanelShown = value;
-    }
-
     private void checkItemInfoLocked(int itemId, ItemInfo item, StackTraceElement[] stackTrace) {
         ItemInfo modelItem = mBgDataModel.itemsIdMap.get(itemId);
         if (modelItem != null && item != modelItem) {
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 5e1a534..e4ce27c 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -15,6 +15,8 @@
  */
 package com.android.launcher3.widget.picker;
 
+import static android.view.View.MeasureSpec.makeMeasureSpec;
+
 import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
 import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGETSTRAY_SEARCHED;
 import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL;
@@ -520,7 +522,12 @@
                                 mNoWidgetsView.getText().length(), noWidgetsViewTextBounds);
                 noWidgetsViewHeight = noWidgetsViewTextBounds.height();
             }
-            float maxTableHeight = (mActivityContext.getDeviceProfile().availableHeightPx
+            doMeasure(
+                    makeMeasureSpec(mActivityContext.getDeviceProfile().availableWidthPx,
+                            MeasureSpec.EXACTLY),
+                    makeMeasureSpec(mActivityContext.getDeviceProfile().availableHeightPx,
+                            MeasureSpec.EXACTLY));
+            float maxTableHeight = (mContent.getMeasuredHeight()
                     - mTabsHeight - mViewPagerTopPadding - getHeaderViewHeight()
                     - noWidgetsViewHeight) * RECOMMENDATION_TABLE_HEIGHT_RATIO;
 
