diff options
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 f48a64551e..0e2a2e7f9e 100644 --- a/services/inputflinger/InputReaderBase.cpp +++ b/services/inputflinger/InputReaderBase.cpp @@ -99,6 +99,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; } @@ -125,4 +135,4 @@ void TouchAffineTransformation::applyTo(float& x, float& y) const { y = newY; } -} // namespace android
\ No newline at end of file +} // namespace android |