Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c884b789 authored by Arpit Singh's avatar Arpit Singh
Browse files

[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
parent 3595275f
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -5806,7 +5806,7 @@ bool InputDispatcher::transferTouchGesture(const sp<IBinder>& fromToken, const s
            return false;
            return false;
        }
        }


        const auto [toWindowHandle, deviceId, pointers, cancellations, pointerDowns] =
        const auto& [toWindowHandle, deviceId, pointers, cancellations, pointerDowns] =
                result.value();
                result.value();


        for (const auto& cancellationArgs : cancellations) {
        for (const auto& cancellationArgs : cancellations) {
@@ -6252,14 +6252,14 @@ status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) {
        return BAD_VALUE;
        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);
    const auto result = mTouchStates.pilferPointers(token, *requestingConnection);
    if (!result.ok()) {
    if (!result.ok()) {
        return result.error().code();
        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;
    const auto cancellations = *result;
    for (const auto& cancellationArgs : cancellations) {
    for (const auto& cancellationArgs : cancellations) {
        LOG_ALWAYS_FATAL_IF(cancellationArgs.mode !=
        LOG_ALWAYS_FATAL_IF(cancellationArgs.mode !=