diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1aa1871..786088e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -32,12 +32,6 @@
     <dimen name="dynamic_grid_hotseat_bottom_tall_padding">0dp</dimen>
     <dimen name="spring_loaded_hotseat_top_margin">76dp</dimen>
 
-    <!-- Qsb -->
-    <!-- Used for adjusting the position of QSB when placed in hotseat. This is a ratio and a higher
-     number signifies that the QSB is close to the hotseat icons and a lower number signifies that
-      it is close to the bottom of the screen -->
-    <item name="qsb_center_factor" format="float" type="dimen">0.325</item>
-
     <dimen name="dynamic_grid_hotseat_side_padding">0dp</dimen>
 
     <!-- Scalable Grid -->
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index bc4a5c3..7131452 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -1,7 +1,5 @@
 package com.android.launcher3;
 
-import static android.appwidget.AppWidgetHostView.getDefaultPaddingForWidget;
-
 import static com.android.launcher3.CellLayout.SPRING_LOADED_PROGRESS;
 import static com.android.launcher3.LauncherAnimUtils.LAYOUT_HEIGHT;
 import static com.android.launcher3.LauncherAnimUtils.LAYOUT_WIDTH;
@@ -77,8 +75,6 @@
     private DragLayer mDragLayer;
     private ImageButton mReconfigureButton;
 
-    private Rect mWidgetPadding;
-
     private final int mBackgroundPadding;
     private final int mTouchTargetWidth;
 
@@ -218,9 +214,6 @@
         mMaxHSpan = info.maxSpanX;
         mMaxVSpan = info.maxSpanY;
 
-        mWidgetPadding = getDefaultPaddingForWidget(getContext(),
-                widgetView.getAppWidgetInfo().provider, null);
-
         // Only show resize handles for the directions in which resizing is possible.
         InvariantDeviceProfile idp = LauncherAppState.getIDP(cellLayout.getContext());
         mVerticalResizeActive = (info.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0
@@ -517,16 +510,12 @@
      */
     private void getSnappedRectRelativeToDragLayer(Rect out) {
         float scale = mWidgetView.getScaleToFit();
-
         mDragLayer.getViewRectRelativeToSelf(mWidgetView, out);
 
-        int width = 2 * mBackgroundPadding
-                + (int) (scale * (out.width() - mWidgetPadding.left - mWidgetPadding.right));
-        int height = 2 * mBackgroundPadding
-                + (int) (scale * (out.height() - mWidgetPadding.top - mWidgetPadding.bottom));
-
-        int x = (int) (out.left - mBackgroundPadding + scale * mWidgetPadding.left);
-        int y = (int) (out.top - mBackgroundPadding + scale * mWidgetPadding.top);
+        int width = 2 * mBackgroundPadding + Math.round(scale * out.width());
+        int height = 2 * mBackgroundPadding + Math.round(scale * out.height());
+        int x = out.left - mBackgroundPadding;
+        int y = out.top - mBackgroundPadding;
 
         out.left = x;
         out.top = y;
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 86c9f16..8675226 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -67,14 +67,12 @@
     private static final int DEFAULT_DOT_SIZE = 100;
     private static final float ALL_APPS_TABLET_MAX_ROWS = 5.5f;
     private static final float MIN_FOLDER_TEXT_SIZE_SP = 16f;
+    private static final float MIN_WIDGET_PADDING_DP = 6f;
 
     public static final PointF DEFAULT_SCALE = new PointF(1.0f, 1.0f);
     public static final ViewScaleProvider DEFAULT_PROVIDER = itemInfo -> DEFAULT_SCALE;
     public static final Consumer<DeviceProfile> DEFAULT_DIMENSION_PROVIDER = dp -> {};
 
-    // Ratio of empty space, qsb should take up to appear visually centered.
-    private final float mQsbCenterFactor;
-
     public final InvariantDeviceProfile inv;
     private final Info mInfo;
     private final DisplayMetrics mMetrics;
@@ -252,6 +250,10 @@
     // Insets
     private final Rect mInsets = new Rect();
     public final Rect workspacePadding = new Rect();
+    // Additional padding added to the widget inside its cellSpace. It is applied outside
+    // the widgetView, such that the actual view size is same as the widget size.
+    public final Rect widgetPadding = new Rect();
+
     // When true, nav bar is on the left side of the screen.
     private boolean mIsSeascape;
 
@@ -314,9 +316,6 @@
         availableHeightPx = windowBounds.availableSize.y;
 
         aspectRatio = ((float) Math.max(widthPx, heightPx)) / Math.min(widthPx, heightPx);
-        boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0;
-        mQsbCenterFactor = res.getFloat(R.dimen.qsb_center_factor);
-
         if (isTwoPanels) {
             if (isLandscape) {
                 mTypeIndex = INDEX_TWO_PANEL_LANDSCAPE;
@@ -730,22 +729,6 @@
         return mInfo;
     }
 
-    /**
-     * We inset the widget padding added by the system and instead rely on the border spacing
-     * between cells to create reliable consistency between widgets
-     */
-    public boolean shouldInsetWidgets() {
-        Rect widgetPadding = inv.defaultWidgetPadding;
-
-        // Check all sides to ensure that the widget won't overlap into another cell, or into
-        // status bar.
-        return workspaceTopPadding > widgetPadding.top
-                && cellLayoutBorderSpacePx.x > widgetPadding.left
-                && cellLayoutBorderSpacePx.y > widgetPadding.top
-                && cellLayoutBorderSpacePx.x > widgetPadding.right
-                && cellLayoutBorderSpacePx.y > widgetPadding.bottom;
-    }
-
     public Builder toBuilder(Context context) {
         WindowBounds bounds = new WindowBounds(
                 widthPx, heightPx, availableWidthPx, availableHeightPx, rotationHint);
@@ -999,6 +982,18 @@
         // Folder icon
         folderIconSizePx = IconNormalizer.getNormalizedCircleSize(iconSizePx);
         folderIconOffsetYPx = (iconSizePx - folderIconSizePx) / 2;
+
+        // Update widget padding:
+        float minSpacing = pxFromDp(MIN_WIDGET_PADDING_DP, mMetrics);
+        if (cellLayoutBorderSpacePx.x < minSpacing
+                || cellLayoutBorderSpacePx.y < minSpacing) {
+            widgetPadding.left = widgetPadding.right =
+                    Math.round(Math.max(0, minSpacing - cellLayoutBorderSpacePx.x));
+            widgetPadding.top = widgetPadding.bottom =
+                    Math.round(Math.max(0, minSpacing - cellLayoutBorderSpacePx.y));
+        } else {
+            widgetPadding.setEmpty();
+        }
     }
 
     /**
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 5e07a3c..3aa582d 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -26,8 +26,6 @@
 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
 
 import android.annotation.TargetApi;
-import android.appwidget.AppWidgetHostView;
-import android.content.ComponentName;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -35,7 +33,6 @@
 import android.content.res.XmlResourceParser;
 import android.graphics.Point;
 import android.graphics.PointF;
-import android.graphics.Rect;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
@@ -192,7 +189,6 @@
     public List<DeviceProfile> supportedProfiles = Collections.EMPTY_LIST;
 
     public Point defaultWallpaperSize;
-    public Rect defaultWidgetPadding;
 
     private final ArrayList<OnIDPChangeListener> mChangeListeners = new ArrayList<>();
 
@@ -443,9 +439,6 @@
                     deviceProfile.numShownHotseatIcons = numMinShownHotseatIconsForTablet;
                     deviceProfile.recalculateHotseatWidthAndBorderSpace();
                 });
-
-        ComponentName cn = new ComponentName(context.getPackageName(), getClass().getName());
-        defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null);
     }
 
     public void addOnChangeListener(OnIDPChangeListener listener) {
diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
index b00199f..a0ceefb 100644
--- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java
+++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java
@@ -46,8 +46,6 @@
     // return an (x, y) value from helper functions. Do NOT use them to maintain other state.
     private final int[] mTmpCellXY = new int[2];
 
-    private final Rect mTempRect = new Rect();
-
     @ContainerType
     private final int mContainerType;
     private final WallpaperManager mWallpaperManager;
@@ -124,13 +122,12 @@
         CellLayoutLayoutParams lp = (CellLayoutLayoutParams) child.getLayoutParams();
         if (child instanceof NavigableAppWidgetHostView) {
             DeviceProfile profile = mActivity.getDeviceProfile();
-            ((NavigableAppWidgetHostView) child).getWidgetInset(profile, mTempRect);
             final PointF appWidgetScale = profile.getAppWidgetScale((ItemInfo) child.getTag());
             lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
-                    appWidgetScale.x, appWidgetScale.y, mBorderSpace, mTempRect);
+                    appWidgetScale.x, appWidgetScale.y, mBorderSpace, profile.widgetPadding);
         } else {
             lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
-                    mBorderSpace, null);
+                    mBorderSpace);
         }
     }
 
@@ -149,13 +146,12 @@
         final DeviceProfile dp = mActivity.getDeviceProfile();
 
         if (child instanceof NavigableAppWidgetHostView) {
-            ((NavigableAppWidgetHostView) child).getWidgetInset(dp, mTempRect);
             final PointF appWidgetScale = dp.getAppWidgetScale((ItemInfo) child.getTag());
             lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
-                    appWidgetScale.x, appWidgetScale.y, mBorderSpace, mTempRect);
+                    appWidgetScale.x, appWidgetScale.y, mBorderSpace, dp.widgetPadding);
         } else {
             lp.setup(mCellWidth, mCellHeight, invertLayoutHorizontally(), mCountX, mCountY,
-                    mBorderSpace, null);
+                    mBorderSpace);
             // Center the icon/folder
             int cHeight = getCellContentHeight();
             int cellPaddingY = dp.isScalableGrid && mContainerType == WORKSPACE
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 6e6f1ac..98016f6 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2912,9 +2912,8 @@
         Rect r = estimateItemPosition(layout, targetCell[0], targetCell[1], spanX, spanY);
         if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET) {
             DeviceProfile profile = mLauncher.getDeviceProfile();
-            if (profile.shouldInsetWidgets() && finalView instanceof NavigableAppWidgetHostView) {
-                Rect widgetPadding = new Rect();
-                ((NavigableAppWidgetHostView) finalView).getWidgetInset(profile, widgetPadding);
+            if (finalView instanceof NavigableAppWidgetHostView) {
+                Rect widgetPadding = profile.widgetPadding;
                 r.left -= widgetPadding.left;
                 r.right += widgetPadding.right;
                 r.top -= widgetPadding.top;
diff --git a/src/com/android/launcher3/celllayout/CellLayoutLayoutParams.java b/src/com/android/launcher3/celllayout/CellLayoutLayoutParams.java
index 4b6a062..bdf7643 100644
--- a/src/com/android/launcher3/celllayout/CellLayoutLayoutParams.java
+++ b/src/com/android/launcher3/celllayout/CellLayoutLayoutParams.java
@@ -113,13 +113,13 @@
      * full/invariant device profile sizes.
      */
     public void setup(int cellWidth, int cellHeight, boolean invertHorizontally, int colCount,
-            int rowCount, Point borderSpace, @Nullable Rect inset) {
+            int rowCount, Point borderSpace) {
         setup(cellWidth, cellHeight, invertHorizontally, colCount, rowCount, 1.0f, 1.0f,
-                borderSpace, inset);
+                borderSpace, null);
     }
 
     /**
-     * Use this method, as opposed to {@link #setup(int, int, boolean, int, int, Point, Rect)},
+     * Use this method, as opposed to {@link #setup(int, int, boolean, int, int, Point)},
      * if the view needs to be scaled.
      *
      * ie. In multi-window mode, we setup widgets so that they are measured and laid out
@@ -150,10 +150,10 @@
             y = topMargin + (myCellY * cellHeight) + (myCellY * borderSpace.y);
 
             if (inset != null) {
-                x -= inset.left;
-                y -= inset.top;
-                width += inset.left + inset.right;
-                height += inset.top + inset.bottom;
+                x += inset.left;
+                y += inset.top;
+                width -= inset.left + inset.right;
+                height -= inset.top + inset.bottom;
             }
         }
     }
diff --git a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
index 7f49aa9..b438e86 100644
--- a/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
+++ b/src/com/android/launcher3/graphics/LauncherPreviewRenderer.java
@@ -451,26 +451,8 @@
         final Size origSize = WidgetSizes.getWidgetSizePx(mDpOrig,
                 launcherWidgetSize.getWidth(), launcherWidgetSize.getHeight());
         final Size newSize = WidgetSizes.getWidgetSizePx(mDp, info.spanX, info.spanY);
-        final Rect previewInset = new Rect();
-        final Rect origInset = new Rect();
-        // When the setup() is called for the LayoutParams, insets are added to the width
-        // and height of the view. This is not accounted for in WidgetSizes and is handled
-        // here.
-        if (mDp.shouldInsetWidgets()) {
-            previewInset.set(mDp.inv.defaultWidgetPadding);
-        } else {
-            previewInset.setEmpty();
-        }
-        if (mDpOrig.shouldInsetWidgets()) {
-            origInset.set(mDpOrig.inv.defaultWidgetPadding);
-        } else {
-            origInset.setEmpty();
-        }
-
-        return new PointF((float) newSize.getWidth() / (origSize.getWidth()
-                + origInset.left + origInset.right),
-                (float) newSize.getHeight() / (origSize.getHeight()
-                + origInset.top + origInset.bottom));
+        return new PointF((float) newSize.getWidth() / origSize.getWidth(),
+                (float) newSize.getHeight() / origSize.getHeight());
     }
 
     private void inflateAndAddPredictedIcon(WorkspaceItemInfo info) {
diff --git a/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java b/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java
index 7030f6d..6f74fd9 100644
--- a/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java
+++ b/src/com/android/launcher3/widget/DatabaseWidgetPreviewLoader.java
@@ -146,8 +146,7 @@
             previewWidth = drawable.getIntrinsicWidth();
             previewHeight = drawable.getIntrinsicHeight();
         } else {
-            Size widgetSize = WidgetSizes.getWidgetPaddedSizePx(mContext, info.provider, dp, spanX,
-                    spanY);
+            Size widgetSize = WidgetSizes.getWidgetSizePx(dp, spanX, spanY);
             previewWidth = widgetSize.getWidth();
             previewHeight = widgetSize.getHeight();
         }
diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfo.java b/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfo.java
index bba1016..10aef9a 100644
--- a/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfo.java
+++ b/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfo.java
@@ -2,7 +2,6 @@
 
 import static com.android.launcher3.Utilities.ATLEAST_S;
 
-import android.appwidget.AppWidgetHostView;
 import android.appwidget.AppWidgetProviderInfo;
 import android.content.ComponentName;
 import android.content.Context;
@@ -105,44 +104,35 @@
         int spanX = 0;
         int spanY = 0;
 
-        Rect widgetPadding = new Rect();
-        Rect localPadding = new Rect();
-        AppWidgetHostView.getDefaultPaddingForWidget(context, provider, widgetPadding);
 
         Point cellSize = new Point();
         for (DeviceProfile dp : idp.supportedProfiles) {
             dp.getCellSize(cellSize);
-            // We want to account for the extra amount of padding that we are adding to the widget
-            // to ensure that it gets the full amount of space that it has requested.
-            // If grids supports insetting widgets, we do not account for widget padding.
-            if (dp.shouldInsetWidgets()) {
-                localPadding.setEmpty();
-            } else {
-                localPadding.set(widgetPadding);
-            }
+            Rect widgetPadding = dp.widgetPadding;
+
             minSpanX = Math.max(minSpanX,
-                    getSpanX(localPadding, minResizeWidth, dp.cellLayoutBorderSpacePx.x,
+                    getSpanX(widgetPadding, minResizeWidth, dp.cellLayoutBorderSpacePx.x,
                             cellSize.x));
             minSpanY = Math.max(minSpanY,
-                    getSpanY(localPadding, minResizeHeight, dp.cellLayoutBorderSpacePx.y,
+                    getSpanY(widgetPadding, minResizeHeight, dp.cellLayoutBorderSpacePx.y,
                             cellSize.y));
 
             if (ATLEAST_S) {
                 if (maxResizeWidth > 0) {
-                    maxSpanX = Math.min(maxSpanX, getSpanX(localPadding, maxResizeWidth,
+                    maxSpanX = Math.min(maxSpanX, getSpanX(widgetPadding, maxResizeWidth,
                             dp.cellLayoutBorderSpacePx.x, cellSize.x));
                 }
                 if (maxResizeHeight > 0) {
-                    maxSpanY = Math.min(maxSpanY, getSpanY(localPadding, maxResizeHeight,
+                    maxSpanY = Math.min(maxSpanY, getSpanY(widgetPadding, maxResizeHeight,
                             dp.cellLayoutBorderSpacePx.y, cellSize.y));
                 }
             }
 
             spanX = Math.max(spanX,
-                    getSpanX(localPadding, minWidth, dp.cellLayoutBorderSpacePx.x,
+                    getSpanX(widgetPadding, minWidth, dp.cellLayoutBorderSpacePx.x,
                             cellSize.x));
             spanY = Math.max(spanY,
-                    getSpanY(localPadding, minHeight, dp.cellLayoutBorderSpacePx.y,
+                    getSpanY(widgetPadding, minHeight, dp.cellLayoutBorderSpacePx.y,
                             cellSize.y));
         }
 
@@ -184,15 +174,22 @@
     }
 
     private int getSpanX(Rect widgetPadding, int widgetWidth, int cellSpacing, float cellWidth) {
-        return Math.max(1, (int) Math.ceil(
-                (widgetWidth + widgetPadding.left + widgetPadding.right + cellSpacing) / (cellWidth
-                        + cellSpacing)));
+        return getSpan(widgetPadding.left + widgetPadding.right,
+                widgetWidth, cellSpacing, cellWidth);
     }
 
     private int getSpanY(Rect widgetPadding, int widgetHeight, int cellSpacing, float cellHeight) {
+        return getSpan(widgetPadding.top + widgetPadding.bottom, widgetHeight,
+                cellSpacing, cellHeight);
+    }
+
+    /**
+     * Solving the equation:
+     *   n * cellSize + (n - 1) * cellSpacing - widgetPadding = widgetSize
+     */
+    private int getSpan(int widgetPadding, int widgetSize, int cellSpacing, float cellSize) {
         return Math.max(1, (int) Math.ceil(
-                (widgetHeight + widgetPadding.top + widgetPadding.bottom + cellSpacing) / (
-                        cellHeight + cellSpacing)));
+                (widgetSize + widgetPadding + cellSpacing) / (cellSize + cellSpacing)));
     }
 
     public String getLabel(PackageManager packageManager) {
diff --git a/src/com/android/launcher3/widget/NavigableAppWidgetHostView.java b/src/com/android/launcher3/widget/NavigableAppWidgetHostView.java
index 3389fb1..f46b214 100644
--- a/src/com/android/launcher3/widget/NavigableAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/NavigableAppWidgetHostView.java
@@ -25,7 +25,6 @@
 import android.view.ViewDebug;
 import android.view.ViewGroup;
 
-import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.Reorderable;
 import com.android.launcher3.dragndrop.DraggableView;
 import com.android.launcher3.util.MultiTranslateDelegate;
@@ -48,13 +47,13 @@
 
     private float mScaleForReorderBounce = 1f;
 
-    private final Rect mTempRect = new Rect();
-
     @ViewDebug.ExportedProperty(category = "launcher")
     private boolean mChildrenFocused;
 
     protected final ActivityContext mActivity;
 
+    private boolean mDisableSetPadding = false;
+
     public NavigableAppWidgetHostView(Context context) {
         super(context);
         mActivity = ActivityContext.lookupContext(context);
@@ -147,6 +146,22 @@
     }
 
     @Override
+    public void setAppWidget(int appWidgetId, AppWidgetProviderInfo info) {
+        // Prevent default padding being set on the view based on provider info. Launcher manages
+        // its own widget spacing
+        mDisableSetPadding = true;
+        super.setAppWidget(appWidgetId, info);
+        mDisableSetPadding = false;
+    }
+
+    @Override
+    public void setPadding(int left, int top, int right, int bottom) {
+        if (!mDisableSetPadding) {
+            super.setPadding(left, top, right, bottom);
+        }
+    }
+
+    @Override
     public boolean dispatchUnhandledMove(View focused, int direction) {
         return mChildrenFocused;
     }
@@ -195,26 +210,6 @@
     public void getWorkspaceVisualDragBounds(Rect bounds) {
         int width = (int) (getMeasuredWidth() * mScaleToFit);
         int height = (int) (getMeasuredHeight() * mScaleToFit);
-
-        getWidgetInset(mActivity.getDeviceProfile(), mTempRect);
-        bounds.set(mTempRect.left, mTempRect.top, width - mTempRect.right,
-                height - mTempRect.bottom);
-    }
-
-    /**
-     * Widgets have padding added by the system. We may choose to inset this padding if the grid
-     * supports it.
-     */
-    public void getWidgetInset(DeviceProfile grid, Rect out) {
-        if (!grid.shouldInsetWidgets()) {
-            out.setEmpty();
-            return;
-        }
-        AppWidgetProviderInfo info = getAppWidgetInfo();
-        if (info == null) {
-            out.set(grid.inv.defaultWidgetPadding);
-        } else {
-            AppWidgetHostView.getDefaultPaddingForWidget(getContext(), info.provider, out);
-        }
+        bounds.set(0, 0, width, height);
     }
 }
diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java
index 410a555..67d21f7 100644
--- a/src/com/android/launcher3/widget/PendingItemDragHelper.java
+++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java
@@ -16,6 +16,8 @@
 
 package com.android.launcher3.widget;
 
+import static com.android.launcher3.widget.util.WidgetSizes.getWidgetSizePx;
+
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.Paint;
@@ -43,7 +45,6 @@
 import com.android.launcher3.icons.LauncherIcons;
 import com.android.launcher3.icons.RoundDrawableWrapper;
 import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener;
-import com.android.launcher3.widget.util.WidgetSizes;
 
 /**
  * Extension of {@link DragPreviewProvider} with logic specific to pending widgets/shortcuts
@@ -121,13 +122,8 @@
                 mAppWidgetHostViewPreview.setAppWidget(/* appWidgetId= */ -1,
                         ((PendingAddWidgetInfo) mAddInfo).info);
                 DeviceProfile deviceProfile = launcher.getDeviceProfile();
-                Rect padding = new Rect();
-                mAppWidgetHostViewPreview.getWidgetInset(deviceProfile, padding);
-                mAppWidgetHostViewPreview.setPadding(padding.left, padding.top, padding.right,
-                        padding.bottom);
                 mAppWidgetHostViewPreview.updateAppWidget(/* remoteViews= */ mRemoteViewsPreview);
-                Size widgetSizes = WidgetSizes.getWidgetPaddedSizePx(launcher,
-                        mAddInfo.componentName, deviceProfile, mAddInfo.spanX, mAddInfo.spanY);
+                Size widgetSizes = getWidgetSizePx(deviceProfile, mAddInfo.spanX, mAddInfo.spanY);
                 mAppWidgetHostViewPreview.measure(
                         MeasureSpec.makeMeasureSpec(widgetSizes.getWidth(), MeasureSpec.EXACTLY),
                         MeasureSpec.makeMeasureSpec(widgetSizes.getHeight(), MeasureSpec.EXACTLY));
diff --git a/src/com/android/launcher3/widget/util/WidgetSizes.java b/src/com/android/launcher3/widget/util/WidgetSizes.java
index 601c1b5..7049509 100644
--- a/src/com/android/launcher3/widget/util/WidgetSizes.java
+++ b/src/com/android/launcher3/widget/util/WidgetSizes.java
@@ -15,8 +15,6 @@
  */
 package com.android.launcher3.widget.util;
 
-import static android.appwidget.AppWidgetHostView.getDefaultPaddingForWidget;
-
 import android.appwidget.AppWidgetHostView;
 import android.appwidget.AppWidgetManager;
 import android.content.ComponentName;
@@ -28,8 +26,6 @@
 import android.util.Size;
 import android.util.SizeF;
 
-import androidx.annotation.Nullable;
-
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.LauncherAppState;
 import com.android.launcher3.R;
@@ -43,24 +39,13 @@
 
     /**
      * Returns the list of all possible sizes, in dp, for a widget of given spans on this device.
-     *
-     * <p>The returned sizes already take into account the system padding, and whether it is applied
-     * or not in that specific configuration.
      */
-    public static ArrayList<SizeF> getWidgetPaddedSizes(Context context, ComponentName provider,
-            int spanX, int spanY) {
-        Rect padding = getDefaultPaddingForWidget(context, provider, /* padding= */ null);
-
+    public static ArrayList<SizeF> getWidgetSizesDp(Context context, int spanX, int spanY) {
         ArrayList<SizeF> sizes = new ArrayList<>(2);
         final float density = context.getResources().getDisplayMetrics().density;
-        final Point cellSize = new Point();
 
         for (DeviceProfile profile : LauncherAppState.getIDP(context).supportedProfiles) {
-            Size widgetSizePx = getWidgetSizePx(profile, spanX, spanY, cellSize);
-            if (!profile.shouldInsetWidgets()) {
-                widgetSizePx = new Size(widgetSizePx.getWidth() - padding.left - padding.right,
-                        widgetSizePx.getHeight() - padding.top - padding.bottom);
-            }
+            Size widgetSizePx = getWidgetSizePx(profile, spanX, spanY);
             sizes.add(new SizeF(widgetSizePx.getWidth() / density,
                     widgetSizePx.getHeight() / density));
         }
@@ -69,21 +54,15 @@
 
     /** Returns the size, in pixels, a widget of given spans & {@code profile}. */
     public static Size getWidgetSizePx(DeviceProfile profile, int spanX, int spanY) {
-        return getWidgetSizePx(profile, spanX, spanY, /* recycledCellSize= */ null);
-    }
+        final int hBorderSpacing = (spanX - 1) * profile.cellLayoutBorderSpacePx.x;
+        final int vBorderSpacing = (spanY - 1) * profile.cellLayoutBorderSpacePx.y;
 
-    /**
-     * Returns the size, in pixels and removing padding, a widget of given spans & {@code profile}.
-     */
-    public static Size getWidgetPaddedSizePx(Context context, ComponentName component,
-            DeviceProfile profile, int spanX, int spanY) {
-        Size size = getWidgetSizePx(profile, spanX, spanY);
-        if (profile.shouldInsetWidgets()) {
-            return size;
-        }
-        Rect padding = getDefaultPaddingForWidget(context, component, /* padding= */ null);
-        return new Size(size.getWidth() - padding.left - padding.right,
-                size.getHeight() - padding.top - padding.bottom);
+        Point cellSize = profile.getCellSize();
+        Rect padding = profile.widgetPadding;
+
+        return new Size(
+                (spanX * cellSize.x) + hBorderSpacing - padding.left - padding.right,
+                (spanY * cellSize.y) + vBorderSpacing - padding.top - padding.bottom);
     }
 
     /**
@@ -92,8 +71,7 @@
      * <p>This size is used by the widget picker. It should NEVER be shared with app widgets.
      *
      * <p>For sizes shared with app widgets, please refer to
-     * {@link #getWidgetPaddedSizes(Context, ComponentName, int, int)} &
-     * {@link #getWidgetPaddedSizePx(Context, ComponentName, DeviceProfile, int, int)}.
+     * {@link #getWidgetSizesDp(Context, int, int)} &
      */
     public static Size getWidgetItemSizePx(Context context, DeviceProfile profile,
             WidgetItem widgetItem) {
@@ -102,27 +80,7 @@
                     .getDimensionPixelSize(R.dimen.widget_preview_shortcut_padding);
             return new Size(dimension, dimension);
         }
-        Size widgetItemSize = getWidgetSizePx(profile, widgetItem.spanX,
-                widgetItem.spanY, /* recycledCellSize= */ null);
-        if (profile.shouldInsetWidgets()) {
-            Rect inset = new Rect();
-            AppWidgetHostView.getDefaultPaddingForWidget(context, widgetItem.componentName, inset);
-            return new Size(widgetItemSize.getWidth() + inset.left + inset.right,
-                    widgetItemSize.getHeight() + inset.top + inset.bottom);
-        }
-        return widgetItemSize;
-    }
-
-    private static Size getWidgetSizePx(DeviceProfile profile, int spanX, int spanY,
-            @Nullable Point recycledCellSize) {
-        final int hBorderSpacing = (spanX - 1) * profile.cellLayoutBorderSpacePx.x;
-        final int vBorderSpacing = (spanY - 1) * profile.cellLayoutBorderSpacePx.y;
-        if (recycledCellSize == null) {
-            recycledCellSize = new Point();
-        }
-        profile.getCellSize(recycledCellSize);
-        return new Size(((spanX * recycledCellSize.x) + hBorderSpacing),
-                ((spanY * recycledCellSize.y) + vBorderSpacing));
+        return getWidgetSizePx(profile, widgetItem.spanX, widgetItem.spanY);
     }
 
     /**
@@ -154,7 +112,7 @@
      */
     public static Bundle getWidgetSizeOptions(Context context, ComponentName provider, int spanX,
             int spanY) {
-        ArrayList<SizeF> paddedSizes = getWidgetPaddedSizes(context, provider, spanX, spanY);
+        ArrayList<SizeF> paddedSizes = getWidgetSizesDp(context, spanX, spanY);
 
         Rect rect = getMinMaxSizes(paddedSizes);
         Bundle options = new Bundle();
diff --git a/tests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java b/tests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java
index b534a41..48cf3df 100644
--- a/tests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java
+++ b/tests/src/com/android/launcher3/widget/LauncherAppWidgetProviderInfoTest.java
@@ -32,6 +32,7 @@
 
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.InvariantDeviceProfile;
+import com.android.launcher3.LauncherAppState;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -161,7 +162,6 @@
         int maxPadding = Math.max(Math.max(padding.left, padding.right),
                 Math.max(padding.top, padding.bottom));
         dp.cellLayoutBorderSpacePx.x = dp.cellLayoutBorderSpacePx.y = maxPadding + 1;
-        Mockito.when(dp.shouldInsetWidgets()).thenReturn(true);
 
         LauncherAppWidgetProviderInfo info = new LauncherAppWidgetProviderInfo();
         info.minWidth = CELL_SIZE * 3;
@@ -184,7 +184,6 @@
         int maxPadding = Math.max(Math.max(padding.left, padding.right),
                 Math.max(padding.top, padding.bottom));
         dp.cellLayoutBorderSpacePx.x = dp.cellLayoutBorderSpacePx.y = maxPadding - 1;
-        Mockito.when(dp.shouldInsetWidgets()).thenReturn(false);
         LauncherAppWidgetProviderInfo info = new LauncherAppWidgetProviderInfo();
         info.minWidth = CELL_SIZE * 3;
         info.minHeight = CELL_SIZE * 3;
@@ -257,14 +256,16 @@
     }
 
     private InvariantDeviceProfile createIDP() {
-        DeviceProfile profile = Mockito.mock(DeviceProfile.class);
+        DeviceProfile dp = LauncherAppState.getIDP(mContext)
+                .getDeviceProfile(mContext).copy(mContext);
+        DeviceProfile profile = Mockito.spy(dp);
         doAnswer(i -> {
             ((Point) i.getArgument(0)).set(CELL_SIZE, CELL_SIZE);
             return null;
         }).when(profile).getCellSize(any(Point.class));
         Mockito.when(profile.getCellSize()).thenReturn(new Point(CELL_SIZE, CELL_SIZE));
         profile.cellLayoutBorderSpacePx = new Point(SPACE_SIZE, SPACE_SIZE);
-        Mockito.when(profile.shouldInsetWidgets()).thenReturn(true);
+        profile.widgetPadding.setEmpty();
 
         InvariantDeviceProfile idp = new InvariantDeviceProfile();
         List<DeviceProfile> supportedProfiles = new ArrayList<>(idp.supportedProfiles);
diff --git a/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java b/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
index d2c2fd7..834f851 100644
--- a/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
+++ b/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
@@ -38,6 +38,7 @@
 
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.InvariantDeviceProfile;
+import com.android.launcher3.LauncherAppState;
 import com.android.launcher3.icons.ComponentWithLabel;
 import com.android.launcher3.icons.IconCache;
 import com.android.launcher3.model.WidgetItem;
@@ -50,6 +51,7 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
+import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 
 import java.util.ArrayList;
@@ -68,7 +70,6 @@
     @Mock
     private IconCache mIconCache;
 
-    @Mock
     private DeviceProfile mTestDeviceProfile;
 
     private Context mContext;
@@ -198,13 +199,18 @@
     }
 
     private void initDP() {
+        DeviceProfile dp = LauncherAppState.getIDP(mContext)
+                .getDeviceProfile(mContext).copy(mContext);
+        mTestDeviceProfile = Mockito.spy(dp);
+
         doAnswer(i -> {
             ((Point) i.getArgument(0)).set(CELL_SIZE, CELL_SIZE);
             return null;
         }).when(mTestDeviceProfile).getCellSize(any(Point.class));
         when(mTestDeviceProfile.getCellSize()).thenReturn(new Point(CELL_SIZE, CELL_SIZE));
         mTestDeviceProfile.cellLayoutBorderSpacePx = new Point(SPACE_SIZE, SPACE_SIZE);
-        when(mTestDeviceProfile.shouldInsetWidgets()).thenReturn(false);
+        mTestDeviceProfile.widgetPadding.setEmpty();
+        mTestDeviceProfile.allAppsIconSizePx = 0;
     }
 
     private void initTestWidgets() {
