Show app widget resize frame after launcher state change

When this bug occurs, the resize frame coordinate is incorrect because
the launcher state animation has not finished when the drag view
finishes animating back to its original position.

Test: Quickly long press and release a widget from the home screen.
      Observe the resize frame is correctly shown around the widget.

Bug: 186370472
Change-Id: I6bfba2e85e3354a215c26203dd22df13db3b8b83
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 98d80fe..b09ec0a 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -103,6 +103,7 @@
 import com.android.launcher3.util.ItemInfoMatcher;
 import com.android.launcher3.util.OverlayEdgeEffect;
 import com.android.launcher3.util.PackageUserKey;
+import com.android.launcher3.util.RunnableList;
 import com.android.launcher3.util.Thunk;
 import com.android.launcher3.util.WallpaperOffsetInterpolator;
 import com.android.launcher3.widget.LauncherAppWidgetHost;
@@ -1921,10 +1922,16 @@
                 if (droppedOnOriginalCellDuringTransition) {
                     // Animate the item to its original position, while simultaneously exiting
                     // spring-loaded mode so the page meets the icon where it was picked up.
+                    final RunnableList callbackList = new RunnableList();
+                    final Runnable onCompleteCallback = onCompleteRunnable;
                     mLauncher.getDragController().animateDragViewToOriginalPosition(
-                            onCompleteRunnable, cell,
+                            /* onComplete= */ callbackList::executeAllAndDestroy, cell,
                             SPRING_LOADED.getTransitionDuration(mLauncher));
-                    mLauncher.getStateManager().goToState(NORMAL);
+                    mLauncher.getStateManager().goToState(NORMAL, /* delay= */ 0,
+                            onCompleteCallback == null
+                                    ? null
+                                    : forSuccessCallback(
+                                            () -> callbackList.add(onCompleteCallback)));
                     mLauncher.getDropTargetBar().onDragEnd();
                     parent.onDropChild(cell);
                     return;