diff options
| -rw-r--r-- | services/inputflinger/InputReaderBase.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/inputflinger/InputReaderBase.cpp b/services/inputflinger/InputReaderBase.cpp index bc53cf52cc..0422d8342b 100644 --- a/services/inputflinger/InputReaderBase.cpp +++ b/services/inputflinger/InputReaderBase.cpp @@ -114,8 +114,10 @@ std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByTyp std::optional<DisplayViewport> result = std::nullopt; for (const DisplayViewport& currentViewport : mDisplays) { // Return the first match - if (currentViewport.type == type && !result) { - result = std::make_optional(currentViewport); + if (currentViewport.type == type) { + if (!result) { + result = std::make_optional(currentViewport); + } count++; } } |