Mark addWindowTargetLocked as const
While figuring out how to refactor 'findTouchedWindowTargetsLocked',
it's helpful to understand where the state is being modified in that
function.
Let's mark addWindowTargetLocked as const to help with the analysis.
Bug: 211379801
Test: build
Change-Id: Ifd0a67bc915996e5401f3d624958660a8680ad19
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index acd3d75..e191d93 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2578,7 +2578,7 @@
void InputDispatcher::addWindowTargetLocked(const sp<WindowInfoHandle>& windowHandle,
int32_t targetFlags, BitSet32 pointerIds,
std::optional<nsecs_t> firstDownTimeInTarget,
- std::vector<InputTarget>& inputTargets) {
+ std::vector<InputTarget>& inputTargets) const {
std::vector<InputTarget>::iterator it =
std::find_if(inputTargets.begin(), inputTargets.end(),
[&windowHandle](const InputTarget& inputTarget) {