Add pointer capture eligibility native APIs
Bug: 202273865
Test: manual
Change-Id: I98a31f4cae1a12f45f789cb1344a258e3de30317
diff --git a/services/inputflinger/dispatcher/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h
index cbb7bad..7564839 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.h
+++ b/services/inputflinger/dispatcher/InputDispatcher.h
@@ -136,6 +136,7 @@
status_t pilferPointers(const sp<IBinder>& token) override;
void requestPointerCapture(const sp<IBinder>& windowToken, bool enabled) override;
bool flushSensor(int deviceId, InputDeviceSensorType sensorType) override;
+ void setDisplayEligibilityForPointerCapture(int displayId, bool isEligible) override;
std::array<uint8_t, 32> sign(const VerifiedInputEvent& event) const;
@@ -420,6 +421,10 @@
// This should be in sync with PointerCaptureChangedEvents dispatched to the input channel.
sp<IBinder> mWindowTokenWithPointerCapture GUARDED_BY(mLock);
+ // Displays that are ineligible for pointer capture.
+ // TODO(b/214621487): Remove or move to a display flag.
+ std::vector<int32_t> mIneligibleDisplaysForPointerCapture GUARDED_BY(mLock);
+
// Disable Pointer Capture as a result of loss of window focus.
void disablePointerCaptureForcedLocked() REQUIRES(mLock);