diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
index 55b8fcc..641fd83 100644
--- a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
+++ b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
@@ -1,17 +1,20 @@
 package com.android.launcher3;
 
+import static com.android.launcher3.LauncherPrefs.APP_WIDGET_IDS;
+import static com.android.launcher3.LauncherPrefs.OLD_APP_WIDGET_IDS;
+
 import android.appwidget.AppWidgetManager;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.util.Log;
 
-import com.android.launcher3.provider.RestoreDbTask;
+import com.android.launcher3.util.IntArray;
 import com.android.launcher3.widget.LauncherWidgetHolder;
 
 public class AppWidgetsRestoredReceiver extends BroadcastReceiver {
 
-    private static final String TAG = "AWRestoredReceiver";
+    private static final String TAG = "AppWidgetsRestoredReceiver";
 
     @Override
     public void onReceive(final Context context, Intent intent) {
@@ -25,7 +28,9 @@
             final int[] oldIds = intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_OLD_IDS);
             final int[] newIds = intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS);
             if (oldIds != null && newIds != null && oldIds.length == newIds.length) {
-                RestoreDbTask.setRestoredAppWidgetIds(context, oldIds, newIds);
+                LauncherPrefs.get(context).putSync(
+                        OLD_APP_WIDGET_IDS.to(IntArray.wrap(oldIds).toConcatString()),
+                        APP_WIDGET_IDS.to(IntArray.wrap(newIds).toConcatString()));
             } else {
                 Log.e(TAG, "Invalid host restored received");
             }
diff --git a/src/com/android/launcher3/provider/RestoreDbTask.java b/src/com/android/launcher3/provider/RestoreDbTask.java
index 10005e5..dbd13b3 100644
--- a/src/com/android/launcher3/provider/RestoreDbTask.java
+++ b/src/com/android/launcher3/provider/RestoreDbTask.java
@@ -529,13 +529,6 @@
         }
     }
 
-    public static void setRestoredAppWidgetIds(Context context, @NonNull int[] oldIds,
-            @NonNull int[] newIds) {
-        LauncherPrefs.get(context).putSync(
-                OLD_APP_WIDGET_IDS.to(IntArray.wrap(oldIds).toConcatString()),
-                APP_WIDGET_IDS.to(IntArray.wrap(newIds).toConcatString()));
-    }
-
     protected static void maybeOverrideShortcuts(Context context, ModelDbController controller,
             SQLiteDatabase db, long currentUser) {
         Map<String, LauncherActivityInfo> activityOverrides = ApiWrapper.getActivityOverrides(
diff --git a/tests/src/com/android/launcher3/AppWidgetsRestoredReceiverTest.kt b/tests/src/com/android/launcher3/AppWidgetsRestoredReceiverTest.kt
new file mode 100644
index 0000000..21abab4
--- /dev/null
+++ b/tests/src/com/android/launcher3/AppWidgetsRestoredReceiverTest.kt
@@ -0,0 +1,171 @@
+package com.android.launcher3
+
+import android.appwidget.AppWidgetManager.ACTION_APPWIDGET_DELETED
+import android.appwidget.AppWidgetManager.ACTION_APPWIDGET_HOST_RESTORED
+import android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_IDS
+import android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_OLD_IDS
+import android.appwidget.AppWidgetManager.EXTRA_HOST_ID
+import android.content.Intent
+import android.platform.uiautomator_helpers.DeviceHelpers
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.launcher3.LauncherPrefs.Companion.APP_WIDGET_IDS
+import com.android.launcher3.LauncherPrefs.Companion.OLD_APP_WIDGET_IDS
+import com.android.launcher3.util.IntArray
+import com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE
+import com.android.launcher3.widget.LauncherWidgetHolder.APPWIDGET_HOST_ID
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/** Tests for [AppWidgetsRestoredReceiver] */
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class AppWidgetsRestoredReceiverTest {
+    private lateinit var launcherPrefs: LauncherPrefs
+    private lateinit var receiverUnderTest: AppWidgetsRestoredReceiver
+
+    @Before
+    fun setup() {
+        launcherPrefs = LauncherPrefs(DeviceHelpers.context)
+        receiverUnderTest = AppWidgetsRestoredReceiver()
+    }
+
+    @After
+    fun tearDown() {
+        launcherPrefs.remove(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)
+    }
+
+    @Test
+    fun `When AppWidgetsRestoredReceiver gets valid broadcast it sets old and new app widget ids`() {
+        // Given
+        val oldIds = intArrayOf(1, 2, 10)
+        val newIds = intArrayOf(10, 11, 12)
+        val expectedOldIds = IntArray.wrap(*oldIds).toConcatString()
+        val expectedNewIds = IntArray.wrap(*newIds).toConcatString()
+        val intent =
+            Intent().apply {
+                component = null
+                `package` = TEST_PACKAGE
+                action = ACTION_APPWIDGET_HOST_RESTORED
+                putExtra(EXTRA_APPWIDGET_OLD_IDS, oldIds)
+                putExtra(EXTRA_APPWIDGET_IDS, newIds)
+                putExtra(EXTRA_HOST_ID, APPWIDGET_HOST_ID)
+            }
+
+        // When
+        receiverUnderTest.onReceive(DeviceHelpers.context, intent)
+
+        // Then
+        assertThat(launcherPrefs.get(OLD_APP_WIDGET_IDS)).isEqualTo(expectedOldIds)
+        assertThat(launcherPrefs.get(APP_WIDGET_IDS)).isEqualTo(expectedNewIds)
+    }
+
+    @Test
+    fun `AppWidgetsRestoredReceiver does not set widget ids when Intent action is invalid`() {
+        // Given
+        val oldIds = intArrayOf(1, 2, 10)
+        val newIds = intArrayOf(10, 11, 12)
+        val intent =
+            Intent().apply {
+                component = null
+                `package` = TEST_PACKAGE
+                action = ACTION_APPWIDGET_DELETED
+                putExtra(EXTRA_APPWIDGET_OLD_IDS, oldIds)
+                putExtra(EXTRA_APPWIDGET_IDS, newIds)
+                putExtra(EXTRA_HOST_ID, APPWIDGET_HOST_ID)
+            }
+
+        // When
+        receiverUnderTest.onReceive(DeviceHelpers.context, intent)
+
+        // Then
+        assertThat(launcherPrefs.has(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)).isFalse()
+    }
+
+    @Test
+    fun `AppWidgetsRestoredReceiver does not set widget ids when Intent host id is not Launcher`() {
+        // Given
+        val oldIds = intArrayOf(1, 2, 10)
+        val newIds = intArrayOf(10, 11, 12)
+        val intent =
+            Intent().apply {
+                component = null
+                `package` = TEST_PACKAGE
+                action = ACTION_APPWIDGET_HOST_RESTORED
+                putExtra(EXTRA_APPWIDGET_OLD_IDS, oldIds)
+                putExtra(EXTRA_APPWIDGET_IDS, newIds)
+                putExtra(EXTRA_HOST_ID, 999999999)
+            }
+
+        // When
+        receiverUnderTest.onReceive(DeviceHelpers.context, intent)
+
+        // Then
+        assertThat(launcherPrefs.has(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)).isFalse()
+    }
+
+    @Test
+    fun `AppWidgetsRestoredReceiver does not set ids when new and old ids differ in length`() {
+        // Given
+        val oldIds = intArrayOf(10)
+        val newIds = intArrayOf(10, 11, 12)
+        val intent =
+            Intent().apply {
+                component = null
+                `package` = TEST_PACKAGE
+                action = ACTION_APPWIDGET_HOST_RESTORED
+                putExtra(EXTRA_APPWIDGET_OLD_IDS, oldIds)
+                putExtra(EXTRA_APPWIDGET_IDS, newIds)
+                putExtra(EXTRA_HOST_ID, APPWIDGET_HOST_ID)
+            }
+
+        // When
+        receiverUnderTest.onReceive(DeviceHelpers.context, intent)
+
+        // Then
+        assertThat(launcherPrefs.has(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)).isFalse()
+    }
+
+    @Test
+    fun `AppWidgetsRestoredReceiver does not set widget ids when old ids not set`() {
+        // Given
+        val newIds = intArrayOf(10, 11, 12)
+        val intent =
+            Intent().apply {
+                component = null
+                `package` = TEST_PACKAGE
+                action = ACTION_APPWIDGET_HOST_RESTORED
+                putExtra(EXTRA_APPWIDGET_IDS, newIds)
+                putExtra(EXTRA_HOST_ID, APPWIDGET_HOST_ID)
+            }
+
+        // When
+        receiverUnderTest.onReceive(DeviceHelpers.context, intent)
+
+        // Then
+        assertThat(launcherPrefs.has(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)).isFalse()
+    }
+
+    @Test
+    fun `AppWidgetsRestoredReceiver does not set widget ids when new ids not set`() {
+        // Given
+        val oldIds = intArrayOf(10, 11, 12)
+        val intent =
+            Intent().apply {
+                component = null
+                `package` = TEST_PACKAGE
+                action = ACTION_APPWIDGET_HOST_RESTORED
+                putExtra(EXTRA_APPWIDGET_OLD_IDS, oldIds)
+                putExtra(EXTRA_HOST_ID, APPWIDGET_HOST_ID)
+            }
+
+        // When
+        receiverUnderTest.onReceive(DeviceHelpers.context, intent)
+
+        // Then
+        assertThat(launcherPrefs.has(OLD_APP_WIDGET_IDS, APP_WIDGET_IDS)).isFalse()
+    }
+}
diff --git a/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java b/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
index a21c9b9..10d9133 100644
--- a/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
+++ b/tests/src/com/android/launcher3/provider/RestoreDbTaskTest.java
@@ -60,6 +60,7 @@
 import com.android.launcher3.LauncherSettings;
 import com.android.launcher3.LauncherSettings.Favorites;
 import com.android.launcher3.model.ModelDbController;
+import com.android.launcher3.util.IntArray;
 import com.android.launcher3.util.LauncherModelHelper;
 
 import org.junit.After;
@@ -233,7 +234,7 @@
         mPrefs.remove(RESTORE_DEVICE);
 
         // When
-        RestoreDbTask.setRestoredAppWidgetIds(mContext, expectedOldIds, expectedNewIds);
+        setRestoredAppWidgetIds(mContext, expectedOldIds, expectedNewIds);
         mTask.restoreAppWidgetIdsIfExists(mContext, mMockController);
 
         // Then
@@ -255,7 +256,7 @@
         RestoreDbTask.setPending(mContext);
 
         // When
-        RestoreDbTask.setRestoredAppWidgetIds(mContext, expectedOldIds, expectedNewIds);
+        setRestoredAppWidgetIds(mContext, expectedOldIds, expectedNewIds);
         mTask.restoreAppWidgetIdsIfExists(mContext, mMockController);
 
         // Then
@@ -283,7 +284,7 @@
         RestoreDbTask.setPending(mContext);
 
         // When
-        RestoreDbTask.setRestoredAppWidgetIds(mContext, expectedOldIds, expectedNewIds);
+        setRestoredAppWidgetIds(mContext, expectedOldIds, expectedNewIds);
         mTask.restoreAppWidgetIdsIfExists(mContext, mMockController);
 
         // Then
@@ -402,4 +403,10 @@
             return index >= 0 ? users.keyAt(index) : -1;
         }
     }
+
+    private void setRestoredAppWidgetIds(Context context, int[] oldIds, int[] newIds) {
+        LauncherPrefs.get(context).putSync(
+                OLD_APP_WIDGET_IDS.to(IntArray.wrap(oldIds).toConcatString()),
+                APP_WIDGET_IDS.to(IntArray.wrap(newIds).toConcatString()));
+    }
 }
