Don`t notify bubble bar of drag exit if it does not show the drop target

Added logic to check if the bubble bar is still showing the drop target
before sending invocking onItemDraggedOutsideBubbleBarDropZone()

Test: Manual
Flag: com.android.wm.shell.enable_create_any_bubble
Bug: 409417227
Change-Id: Ia3e7b859fdd3f60dff2dd1b97744318d40509f02
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java
index d608413..c9671e6 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java
@@ -663,9 +663,11 @@
                     mSession = null;
             }
         });
-        // notify bubbles of drag cancel
-        mCurrentBubbleBarTarget = null;
-        mBubbleBarDragListener.onItemDraggedOutsideBubbleBarDropZone();
+        if (mCurrentBubbleBarTarget != null) {
+            // bubble bar is still showing drop target, notify bubbles of drag cancel
+            mCurrentBubbleBarTarget = null;
+            mBubbleBarDragListener.onItemDraggedOutsideBubbleBarDropZone();
+        }
         // Reset the state if we previously force-ignore the bottom margin
         mDropZoneView1.setForceIgnoreBottomMargin(false);
         mDropZoneView2.setForceIgnoreBottomMargin(false);
@@ -693,6 +695,7 @@
             mBubbleBarDragListener.onItemDroppedOverBubbleBarDragZone(mCurrentBubbleBarTarget,
                     appData);
         }
+        mCurrentBubbleBarTarget = null;
 
         // Start animating the drop UI out with the drag surface
         hide(event, dropCompleteCallback);