diff options
| author | 2019-09-25 15:07:32 -0700 | |
|---|---|---|
| committer | 2019-09-25 15:07:32 -0700 | |
| commit | 7d3847311e3d3955ea91facb0b83b824e16efdd4 (patch) | |
| tree | eac363d447d7a117746f5abc7bbf5b8ed3ee1883 | |
| parent | f6d07ae91f109a097b0ea05dd103138e38e0b087 (diff) | |
getDisplayViewportByType doesn't count more than one viewport
Bug: none
Test: none
Change-Id: I795f14bb1d7bd7f62a0d2a6eb301f3cced4f5109
| -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++; } } |