summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arpit Singh <arpitks@google.com> 2025-02-06 16:07:50 +0000
committer Arpit Singh <arpitks@google.com> 2025-02-07 19:08:41 +0000
commitc884b789da380e5db59691fc8fd1a0b5329610e7 (patch)
tree62b1b7ec75a7d4e5f923aa4a32b38bb53d1061c6
parent3595275f191e04cb6f180d4c8816bac83e955bc9 (diff)
[22/n Dispatcher Refactor] resolving nits from previous review
This CL resolves following nits 1. Adds a reference to avoid copy from ag/31432553 2. Move a deceleration near to the use from ag/31432555 Bug: 245989146 Test: atest inputflinger_tests Flag: EXEMPT refactor Change-Id: I8dcf65251b8ac00fdcde3a97113825197272c326
-rw-r--r--services/inputflinger/dispatcher/InputDispatcher.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index a500567be4..7f62da200c 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -5806,7 +5806,7 @@ bool InputDispatcher::transferTouchGesture(const sp<IBinder>& fromToken, const s
return false;
}
- const auto [toWindowHandle, deviceId, pointers, cancellations, pointerDowns] =
+ const auto& [toWindowHandle, deviceId, pointers, cancellations, pointerDowns] =
result.value();
for (const auto& cancellationArgs : cancellations) {
@@ -6252,14 +6252,14 @@ status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) {
return BAD_VALUE;
}
- ScopedSyntheticEventTracer traceContext(mTracer);
- CancelationOptions options(CancelationOptions::Mode::CANCEL_POINTER_EVENTS,
- "input channel stole pointer stream", traceContext.getTracker());
const auto result = mTouchStates.pilferPointers(token, *requestingConnection);
if (!result.ok()) {
return result.error().code();
}
+ ScopedSyntheticEventTracer traceContext(mTracer);
+ CancelationOptions options(CancelationOptions::Mode::CANCEL_POINTER_EVENTS,
+ "input channel stole pointer stream", traceContext.getTracker());
const auto cancellations = *result;
for (const auto& cancellationArgs : cancellations) {
LOG_ALWAYS_FATAL_IF(cancellationArgs.mode !=