diff options
| author | 2020-01-09 11:39:16 -0800 | |
|---|---|---|
| committer | 2020-01-23 10:54:07 -0800 | |
| commit | 888a6a41edc5e4250076b7e36e4d626eb70edc71 (patch) | |
| tree | 95cf7f6dfe941cfcbb2f831ac1243239fae32ba0 /services/inputflinger/InputReaderBase.cpp | |
| parent | c34a8a2e960393f434d8307edeb495d0e301c70d (diff) | |
Let InputReader set mouse cursor's display.
InputReader was already responsible to bind device/event and display. It
makes sense to further extend it to control the display where mouse
cursor is shown.
Bug: 146385350
Test: Mouse cursor shows up at expected display.
Test: atest inputflinger_tests
Change-Id: Ie7a9546550b70c8834462b06de929472196fe713
Diffstat (limited to 'services/inputflinger/InputReaderBase.cpp')
| -rw-r--r-- | services/inputflinger/InputReaderBase.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/services/inputflinger/InputReaderBase.cpp b/services/inputflinger/InputReaderBase.cpp index 2d6f2c1cc9..b2dadf8460 100644 --- a/services/inputflinger/InputReaderBase.cpp +++ b/services/inputflinger/InputReaderBase.cpp @@ -125,6 +125,16 @@ std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByPor return std::nullopt; } +std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportById( + int32_t displayId) const { + for (const DisplayViewport& currentViewport : mDisplays) { + if (currentViewport.displayId == displayId) { + return std::make_optional(currentViewport); + } + } + return std::nullopt; +} + void InputReaderConfiguration::setDisplayViewports(const std::vector<DisplayViewport>& viewports) { mDisplays = viewports; } @@ -151,4 +161,4 @@ void TouchAffineTransformation::applyTo(float& x, float& y) const { y = newY; } -} // namespace android
\ No newline at end of file +} // namespace android |