Revert "Revert "Use std::set instead of SortedVector""
This reverts commit 2d8cc8945eb1c1be5ce6a262613a5aae6e257d06.
Reason for revert: Likely build was having issues, and the original CLs were fine. From looking into the issues more closely, it appears that the topic was not merged atomically.
Change-Id: I42393e615066b4cf10aa953757a3f43be5676a2f
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index eee49d5..2de5ffa 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -1094,8 +1094,8 @@
}
if (!changes || (changes & InputReaderConfiguration::CHANGE_ENABLED_STATE)) {
- ssize_t index = config->disabledDevices.indexOf(mId);
- bool enabled = index < 0;
+ auto it = config->disabledDevices.find(mId);
+ bool enabled = it == config->disabledDevices.end();
setEnabled(enabled, when);
}