From 8158e7e33a95732b9963909b9fb471678ff8b7d4 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Mon, 15 Oct 2018 14:28:20 -0700 Subject: Add physical port to display viewport DisplayViewport now also stores the physical port information of the associated display. The physical port of the display can be used to match an input device to the corresponding viewport, therefore ensuring that a specific input device generates events that go to a particular display. The associations are provided to InputReaderConfiguration by the JNI callback. Change getViewport strategy once more. Now, uniqueId match by itself is sufficient (viewport type does not need to match if the viewport with the matching uniqueId is found). Added a check for assumptions about the number of viewports that can have the same type. These should be relaxed once (and if) support for multiple internal viewports is added. Bug: 116239493 Test: atest -a libinput_tests inputflinger_tests Change-Id: I1c84f281e8c255f12aea0d15939c70685fe94c41 --- services/inputflinger/InputReader.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'services/inputflinger/InputReader.h') diff --git a/services/inputflinger/InputReader.h b/services/inputflinger/InputReader.h index 1786fe8f26..13f1bedb65 100644 --- a/services/inputflinger/InputReader.h +++ b/services/inputflinger/InputReader.h @@ -252,6 +252,9 @@ public: inline bool isExternal() { return mIsExternal; } inline void setExternal(bool external) { mIsExternal = external; } + inline std::optional getAssociatedDisplayPort() const { + return mAssociatedDisplayPort; + } inline void setMic(bool hasMic) { mHasMic = hasMic; } inline bool hasMic() const { return mHasMic; } @@ -324,6 +327,7 @@ private: uint32_t mSources; bool mIsExternal; + std::optional mAssociatedDisplayPort; bool mHasMic; bool mDropUntilNextSync; @@ -1501,6 +1505,8 @@ private: VelocityControl mWheelXVelocityControl; VelocityControl mWheelYVelocityControl; + std::optional findViewport(); + void resetExternalStylus(); void clearStylusDataPendingFlags(); -- cgit v1.2.3-59-g8ed1b