Move drag event to InputDispatcher (3/n)

This CL re-implements the drag hover detecting in InputDispatcher,
moving it away from DragState.

Currently, any window or windowless surface could receive drag event if
it is visible and touch-deliverable. But it's hard to tell if a surface
could receive this drag event in WM side because we didn't know the
final touch region of the surface that could be cropped by others.

The new expected behaviors are:
- DragAndDropController will transfer touch to drag window when perform
  drag, and InputDispatcher will store drag window when transfer
  touch focus.
- InputDispatcher will start detecting drag hover window by pointer.
- Send drag exit if drag pointer leave the window.
- Send drag event to the target window during moving.

Bug: 158242495
Test: atest inputflinger_test
Change-Id: I0266f81afd4fb60280ae7694dd7241500cf9cb18
diff --git a/services/inputflinger/dispatcher/Entry.cpp b/services/inputflinger/dispatcher/Entry.cpp
index a19b04f..5270b8a 100644
--- a/services/inputflinger/dispatcher/Entry.cpp
+++ b/services/inputflinger/dispatcher/Entry.cpp
@@ -130,6 +130,23 @@
                         pointerCaptureEnabled ? "true" : "false");
 }
 
+// --- DragEntry ---
+
+// Drag notifications always go to apps, so set the flag POLICY_FLAG_PASS_TO_USER for all entries
+DragEntry::DragEntry(int32_t id, nsecs_t eventTime, sp<IBinder> connectionToken, bool isExiting,
+                     float x, float y)
+      : EventEntry(id, Type::DRAG, eventTime, POLICY_FLAG_PASS_TO_USER),
+        connectionToken(connectionToken),
+        isExiting(isExiting),
+        x(x),
+        y(y) {}
+
+DragEntry::~DragEntry() {}
+
+std::string DragEntry::getDescription() const {
+    return StringPrintf("DragEntry(isExiting=%s, x=%f, y=%f)", isExiting ? "true" : "false", x, y);
+}
+
 // --- KeyEntry ---
 
 KeyEntry::KeyEntry(int32_t id, nsecs_t eventTime, int32_t deviceId, uint32_t source,