InputDispatcher: Implement spy windows

We implement spy windows as outlined in go/spy-windows.

Bug: 162194035
Test: atest inputflinger_tests
Change-Id: Iea3404329184ab40492666f2a66396e9d8cb3594
diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp
index 5f3a726..e92be01 100644
--- a/libs/gui/WindowInfo.cpp
+++ b/libs/gui/WindowInfo.cpp
@@ -43,6 +43,10 @@
     return flags.test(Flag::SPLIT_TOUCH);
 }
 
+bool WindowInfo::isSpy() const {
+    return inputFeatures.test(Feature::SPY);
+}
+
 bool WindowInfo::overlaps(const WindowInfo* other) const {
     return frameLeft < other->frameRight && frameRight > other->frameLeft &&
             frameTop < other->frameBottom && frameBottom > other->frameTop;
diff --git a/libs/gui/include/gui/WindowInfo.h b/libs/gui/include/gui/WindowInfo.h
index 54a372c..808afe4 100644
--- a/libs/gui/include/gui/WindowInfo.h
+++ b/libs/gui/include/gui/WindowInfo.h
@@ -137,6 +137,7 @@
         DISABLE_USER_ACTIVITY = 1u << 2,
         DROP_INPUT = 1u << 3,
         DROP_INPUT_IF_OBSCURED = 1u << 4,
+        SPY = 1u << 5,
     };
 
     /* These values are filled in by the WM and passed through SurfaceFlinger
@@ -215,6 +216,8 @@
 
     bool supportsSplitTouch() const;
 
+    bool isSpy() const;
+
     bool overlaps(const WindowInfo* other) const;
 
     bool operator==(const WindowInfo& inputChannel) const;