Loading include/input/Input.h +19 −0 Original line number Diff line number Diff line Loading @@ -1025,6 +1025,25 @@ private: std::queue<std::unique_ptr<TouchModeEvent>> mTouchModeEventPool; }; /* * Describes a unique request to enable or disable Pointer Capture. */ struct PointerCaptureRequest { public: inline PointerCaptureRequest() : enable(false), seq(0) {} inline PointerCaptureRequest(bool enable, uint32_t seq) : enable(enable), seq(seq) {} inline bool operator==(const PointerCaptureRequest& other) const { return enable == other.enable && seq == other.seq; } explicit inline operator bool() const { return enable; } // True iff this is a request to enable Pointer Capture. bool enable; // The sequence number for the request. uint32_t seq; }; } // namespace android #endif // _LIBINPUT_INPUT_H services/inputflinger/InputListener.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -287,16 +287,16 @@ void NotifyDeviceResetArgs::notify(const sp<InputListenerInterface>& listener) c // --- NotifyPointerCaptureChangedArgs --- NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs(int32_t id, nsecs_t eventTime, bool enabled) : NotifyArgs(id, eventTime), enabled(enabled) {} NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs( int32_t id, nsecs_t eventTime, const PointerCaptureRequest& request) : NotifyArgs(id, eventTime), request(request) {} NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs( const NotifyPointerCaptureChangedArgs& other) : NotifyArgs(other.id, other.eventTime), enabled(other.enabled) {} : NotifyArgs(other.id, other.eventTime), request(other.request) {} bool NotifyPointerCaptureChangedArgs::operator==(const NotifyPointerCaptureChangedArgs& rhs) const { return id == rhs.id && eventTime == rhs.eventTime && enabled == rhs.enabled; return id == rhs.id && eventTime == rhs.eventTime && request == rhs.request; } void NotifyPointerCaptureChangedArgs::notify(const sp<InputListenerInterface>& listener) const { Loading services/inputflinger/InputReaderBase.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,9 @@ std::string InputReaderConfiguration::changesToString(uint32_t changes) { if (changes & CHANGE_EXTERNAL_STYLUS_PRESENCE) { result += "EXTERNAL_STYLUS_PRESENCE | "; } if (changes & CHANGE_POINTER_CAPTURE) { result += "POINTER_CAPTURE | "; } if (changes & CHANGE_ENABLED_STATE) { result += "ENABLED_STATE | "; } Loading services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ private: void onPointerDownOutsideFocus(const sp<IBinder>& newToken) override {} void setPointerCapture(bool enabled) override {} void setPointerCapture(const PointerCaptureRequest&) override {} void notifyDropWindow(const sp<IBinder>&, float x, float y) override {} Loading services/inputflinger/dispatcher/Entry.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -119,15 +119,15 @@ std::string FocusEntry::getDescription() const { // PointerCaptureChanged notifications always go to apps, so set the flag POLICY_FLAG_PASS_TO_USER // for all entries. PointerCaptureChangedEntry::PointerCaptureChangedEntry(int32_t id, nsecs_t eventTime, bool hasPointerCapture) const PointerCaptureRequest& request) : EventEntry(id, Type::POINTER_CAPTURE_CHANGED, eventTime, POLICY_FLAG_PASS_TO_USER), pointerCaptureEnabled(hasPointerCapture) {} pointerCaptureRequest(request) {} PointerCaptureChangedEntry::~PointerCaptureChangedEntry() {} std::string PointerCaptureChangedEntry::getDescription() const { return StringPrintf("PointerCaptureChangedEvent(pointerCaptureEnabled=%s)", pointerCaptureEnabled ? "true" : "false"); pointerCaptureRequest.enable ? "true" : "false"); } // --- DragEntry --- Loading Loading
include/input/Input.h +19 −0 Original line number Diff line number Diff line Loading @@ -1025,6 +1025,25 @@ private: std::queue<std::unique_ptr<TouchModeEvent>> mTouchModeEventPool; }; /* * Describes a unique request to enable or disable Pointer Capture. */ struct PointerCaptureRequest { public: inline PointerCaptureRequest() : enable(false), seq(0) {} inline PointerCaptureRequest(bool enable, uint32_t seq) : enable(enable), seq(seq) {} inline bool operator==(const PointerCaptureRequest& other) const { return enable == other.enable && seq == other.seq; } explicit inline operator bool() const { return enable; } // True iff this is a request to enable Pointer Capture. bool enable; // The sequence number for the request. uint32_t seq; }; } // namespace android #endif // _LIBINPUT_INPUT_H
services/inputflinger/InputListener.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -287,16 +287,16 @@ void NotifyDeviceResetArgs::notify(const sp<InputListenerInterface>& listener) c // --- NotifyPointerCaptureChangedArgs --- NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs(int32_t id, nsecs_t eventTime, bool enabled) : NotifyArgs(id, eventTime), enabled(enabled) {} NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs( int32_t id, nsecs_t eventTime, const PointerCaptureRequest& request) : NotifyArgs(id, eventTime), request(request) {} NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs( const NotifyPointerCaptureChangedArgs& other) : NotifyArgs(other.id, other.eventTime), enabled(other.enabled) {} : NotifyArgs(other.id, other.eventTime), request(other.request) {} bool NotifyPointerCaptureChangedArgs::operator==(const NotifyPointerCaptureChangedArgs& rhs) const { return id == rhs.id && eventTime == rhs.eventTime && enabled == rhs.enabled; return id == rhs.id && eventTime == rhs.eventTime && request == rhs.request; } void NotifyPointerCaptureChangedArgs::notify(const sp<InputListenerInterface>& listener) const { Loading
services/inputflinger/InputReaderBase.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,9 @@ std::string InputReaderConfiguration::changesToString(uint32_t changes) { if (changes & CHANGE_EXTERNAL_STYLUS_PRESENCE) { result += "EXTERNAL_STYLUS_PRESENCE | "; } if (changes & CHANGE_POINTER_CAPTURE) { result += "POINTER_CAPTURE | "; } if (changes & CHANGE_ENABLED_STATE) { result += "ENABLED_STATE | "; } Loading
services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ private: void onPointerDownOutsideFocus(const sp<IBinder>& newToken) override {} void setPointerCapture(bool enabled) override {} void setPointerCapture(const PointerCaptureRequest&) override {} void notifyDropWindow(const sp<IBinder>&, float x, float y) override {} Loading
services/inputflinger/dispatcher/Entry.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -119,15 +119,15 @@ std::string FocusEntry::getDescription() const { // PointerCaptureChanged notifications always go to apps, so set the flag POLICY_FLAG_PASS_TO_USER // for all entries. PointerCaptureChangedEntry::PointerCaptureChangedEntry(int32_t id, nsecs_t eventTime, bool hasPointerCapture) const PointerCaptureRequest& request) : EventEntry(id, Type::POINTER_CAPTURE_CHANGED, eventTime, POLICY_FLAG_PASS_TO_USER), pointerCaptureEnabled(hasPointerCapture) {} pointerCaptureRequest(request) {} PointerCaptureChangedEntry::~PointerCaptureChangedEntry() {} std::string PointerCaptureChangedEntry::getDescription() const { return StringPrintf("PointerCaptureChangedEvent(pointerCaptureEnabled=%s)", pointerCaptureEnabled ? "true" : "false"); pointerCaptureRequest.enable ? "true" : "false"); } // --- DragEntry --- Loading