Loading services/inputflinger/dispatcher/InputDispatcher.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -7202,6 +7202,12 @@ void InputDispatcher::setInputMethodConnectionIsActive(bool isActive) { } } void InputDispatcher::setDisplayTopology( const android::DisplayTopologyGraph& displayTopologyGraph) { std::scoped_lock _l(mLock); mWindowInfos.setDisplayTopology(displayTopologyGraph); } InputDispatcher::ConnectionManager::ConnectionManager(const sp<android::Looper>& looper) : mLooper(looper) {} Loading Loading @@ -7337,6 +7343,11 @@ void InputDispatcher::DispatcherWindowInfo::setMaximumObscuringOpacityForTouch(f mMaximumObscuringOpacityForTouch = opacity; } void InputDispatcher::DispatcherWindowInfo::setDisplayTopology( const DisplayTopologyGraph& displayTopologyGraph) { mTopology = displayTopologyGraph; } ftl::Flags<InputTarget::Flags> InputDispatcher::DispatcherTouchState::getTargetFlags( const sp<WindowInfoHandle>& targetWindow, vec2 targetPosition, bool isSplit, const DispatcherWindowInfo& windowInfos) { Loading services/inputflinger/dispatcher/InputDispatcher.h +9 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,8 @@ public: void setInputMethodConnectionIsActive(bool isActive) override; void setDisplayTopology(const DisplayTopologyGraph& displayTopologyGraph) override; private: enum class DropReason { NOT_DROPPED, Loading Loading @@ -291,6 +293,8 @@ private: void setMaximumObscuringOpacityForTouch(float opacity); void setDisplayTopology(const DisplayTopologyGraph& displayTopologyGraph); // Get a reference to window handles by display, return an empty vector if not found. const std::vector<sp<android::gui::WindowInfoHandle>>& getWindowHandlesForDisplay( ui::LogicalDisplayId displayId) const; Loading Loading @@ -341,6 +345,11 @@ private: std::unordered_map<ui::LogicalDisplayId /*displayId*/, android::gui::DisplayInfo> mDisplayInfos; float mMaximumObscuringOpacityForTouch{1.0f}; // Topology is initialized with default-constructed value, which is an empty topology until // we receive setDisplayTopology call. Meanwhile we will treat every display as an // independent display. DisplayTopologyGraph mTopology; }; DispatcherWindowInfo mWindowInfos GUARDED_BY(mLock); Loading services/inputflinger/dispatcher/include/InputDispatcherInterface.h +6 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <android/os/InputEventInjectionSync.h> #include <gui/InputApplication.h> #include <gui/WindowInfo.h> #include <input/DisplayTopologyGraph.h> #include <input/InputDevice.h> #include <input/InputTransport.h> #include <unordered_map> Loading Loading @@ -243,6 +244,11 @@ public: * Notify the dispatcher that the state of the input method connection changed. */ virtual void setInputMethodConnectionIsActive(bool isActive) = 0; /* * Notify the dispatcher of the latest DisplayTopology. */ virtual void setDisplayTopology(const DisplayTopologyGraph& displayTopologyGraph) = 0; }; } // namespace android Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -7202,6 +7202,12 @@ void InputDispatcher::setInputMethodConnectionIsActive(bool isActive) { } } void InputDispatcher::setDisplayTopology( const android::DisplayTopologyGraph& displayTopologyGraph) { std::scoped_lock _l(mLock); mWindowInfos.setDisplayTopology(displayTopologyGraph); } InputDispatcher::ConnectionManager::ConnectionManager(const sp<android::Looper>& looper) : mLooper(looper) {} Loading Loading @@ -7337,6 +7343,11 @@ void InputDispatcher::DispatcherWindowInfo::setMaximumObscuringOpacityForTouch(f mMaximumObscuringOpacityForTouch = opacity; } void InputDispatcher::DispatcherWindowInfo::setDisplayTopology( const DisplayTopologyGraph& displayTopologyGraph) { mTopology = displayTopologyGraph; } ftl::Flags<InputTarget::Flags> InputDispatcher::DispatcherTouchState::getTargetFlags( const sp<WindowInfoHandle>& targetWindow, vec2 targetPosition, bool isSplit, const DispatcherWindowInfo& windowInfos) { Loading
services/inputflinger/dispatcher/InputDispatcher.h +9 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,8 @@ public: void setInputMethodConnectionIsActive(bool isActive) override; void setDisplayTopology(const DisplayTopologyGraph& displayTopologyGraph) override; private: enum class DropReason { NOT_DROPPED, Loading Loading @@ -291,6 +293,8 @@ private: void setMaximumObscuringOpacityForTouch(float opacity); void setDisplayTopology(const DisplayTopologyGraph& displayTopologyGraph); // Get a reference to window handles by display, return an empty vector if not found. const std::vector<sp<android::gui::WindowInfoHandle>>& getWindowHandlesForDisplay( ui::LogicalDisplayId displayId) const; Loading Loading @@ -341,6 +345,11 @@ private: std::unordered_map<ui::LogicalDisplayId /*displayId*/, android::gui::DisplayInfo> mDisplayInfos; float mMaximumObscuringOpacityForTouch{1.0f}; // Topology is initialized with default-constructed value, which is an empty topology until // we receive setDisplayTopology call. Meanwhile we will treat every display as an // independent display. DisplayTopologyGraph mTopology; }; DispatcherWindowInfo mWindowInfos GUARDED_BY(mLock); Loading
services/inputflinger/dispatcher/include/InputDispatcherInterface.h +6 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <android/os/InputEventInjectionSync.h> #include <gui/InputApplication.h> #include <gui/WindowInfo.h> #include <input/DisplayTopologyGraph.h> #include <input/InputDevice.h> #include <input/InputTransport.h> #include <unordered_map> Loading Loading @@ -243,6 +244,11 @@ public: * Notify the dispatcher that the state of the input method connection changed. */ virtual void setInputMethodConnectionIsActive(bool isActive) = 0; /* * Notify the dispatcher of the latest DisplayTopology. */ virtual void setDisplayTopology(const DisplayTopologyGraph& displayTopologyGraph) = 0; }; } // namespace android