Fixing widgets get deteled because of double bind

If the AppWidgetHost starts listening in the middle of bind, it rebinds
the old widgets before a new widget is bound, leading to double bind.
We should clear all pending binds, before starting a rebind. As an
extra check only rebind a view which is attached to the screen.

Bug: 73814840
Change-Id: Ie3af683dc4095b158547e700d11e4faf7999466f
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 7209d9d..5ac53a8 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2239,6 +2239,7 @@
         // Clear the workspace because it's going to be rebound
         mWorkspace.clearDropTargets();
         mWorkspace.removeAllWorkspaceScreens();
+        mAppWidgetHost.clearViews();
 
         if (mHotseat != null) {
             mHotseat.resetLayout();