Fix the drag window still alive after drop failed

We should report the invalid drop window even if there is no visible
window can be found, the DragState from WindowManager side would
decide playing a cancel animation or remove the drag window immediately.

Test: atest CrossAppDragAndDrop
Test: atest inputflinger_tests
Bug: 182792292
Bug: 183880545
Bug: 183880412
Bug: 182234653
Bug: 183877512
Change-Id: I017caeb2ed953e395831cd5b77186f5ab3d33765
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 073455a..4e05847 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2326,6 +2326,8 @@
     if (dropWindow) {
         vec2 local = dropWindow->getInfo()->transform.transform(x, y);
         notifyDropWindowLocked(dropWindow->getToken(), local.x, local.y);
+    } else {
+        notifyDropWindowLocked(nullptr, 0, 0);
     }
     mDragState.reset();
 }
@@ -2372,6 +2374,7 @@
     } else if (maskedAction == AMOTION_EVENT_ACTION_UP) {
         finishDragAndDrop(entry.displayId, x, y);
     } else if (maskedAction == AMOTION_EVENT_ACTION_CANCEL) {
+        notifyDropWindowLocked(nullptr, 0, 0);
         mDragState.reset();
     }
 }