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

Commit 101ee9b6 authored by Harry Cutts's avatar Harry Cutts
Browse files

inputflinger: fix format of parameter name comments

The Google C++ style guide [0] suggests that parameter name comments
should be of the form `/*paramName=*/value`. This potentially allows
tooling to check that the parameter names are correct, too.

[0]: https://google.github.io/styleguide/cppguide.html#Function_Argument_Comments

Bug: 245989146
Test: presubmit
Change-Id: I6239599692ada74438ebd8141adc05afacec915d
parent 3985065a
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -2980,7 +2980,7 @@ InputDispatcher::TouchOcclusionInfo InputDispatcher::computeTouchOcclusionInfoLo
            !haveSameApplicationToken(windowInfo, otherInfo)) {
            !haveSameApplicationToken(windowInfo, otherInfo)) {
            if (DEBUG_TOUCH_OCCLUSION) {
            if (DEBUG_TOUCH_OCCLUSION) {
                info.debugInfo.push_back(
                info.debugInfo.push_back(
                        dumpWindowForTouchOcclusion(otherInfo, /* isTouchedWindow */ false));
                        dumpWindowForTouchOcclusion(otherInfo, /*isTouchedWindow=*/false));
            }
            }
            // canBeObscuredBy() has returned true above, which means this window is untrusted, so
            // canBeObscuredBy() has returned true above, which means this window is untrusted, so
            // we perform the checks below to see if the touch can be propagated or not based on the
            // we perform the checks below to see if the touch can be propagated or not based on the
@@ -3008,8 +3008,7 @@ InputDispatcher::TouchOcclusionInfo InputDispatcher::computeTouchOcclusionInfoLo
        }
        }
    }
    }
    if (DEBUG_TOUCH_OCCLUSION) {
    if (DEBUG_TOUCH_OCCLUSION) {
        info.debugInfo.push_back(
        info.debugInfo.push_back(dumpWindowForTouchOcclusion(windowInfo, /*isTouchedWindow=*/true));
                dumpWindowForTouchOcclusion(windowInfo, /* isTouchedWindow */ true));
    }
    }
    return info;
    return info;
}
}
@@ -6705,7 +6704,7 @@ void InputDispatcher::displayRemoved(int32_t displayId) {
    { // acquire lock
    { // acquire lock
        std::scoped_lock _l(mLock);
        std::scoped_lock _l(mLock);
        // Set an empty list to remove all handles from the specific display.
        // Set an empty list to remove all handles from the specific display.
        setInputWindowsLocked(/* window handles */ {}, displayId);
        setInputWindowsLocked(/*windowInfoHandles=*/{}, displayId);
        setFocusedApplicationLocked(displayId, nullptr);
        setFocusedApplicationLocked(displayId, nullptr);
        // Call focus resolver to clean up stale requests. This must be called after input windows
        // Call focus resolver to clean up stale requests. This must be called after input windows
        // have been removed for the removed display.
        // have been removed for the removed display.
+5 −5
Original line number Original line Diff line number Diff line
@@ -347,7 +347,7 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
                                               AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                               AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                               &pointerCoords, mXPrecision, mYPrecision,
                                               &pointerCoords, mXPrecision, mYPrecision,
                                               xCursorPosition, yCursorPosition, downTime,
                                               xCursorPosition, yCursorPosition, downTime,
                                               /* videoFrames */ {}));
                                               /*videoFrames=*/{}));
            }
            }
        }
        }


@@ -357,7 +357,7 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
                                       AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                       AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                       &pointerCoords, mXPrecision, mYPrecision, xCursorPosition,
                                       &pointerCoords, mXPrecision, mYPrecision, xCursorPosition,
                                       yCursorPosition, downTime,
                                       yCursorPosition, downTime,
                                       /* videoFrames */ {}));
                                       /*videoFrames=*/{}));


        if (buttonsPressed) {
        if (buttonsPressed) {
            BitSet32 pressed(buttonsPressed);
            BitSet32 pressed(buttonsPressed);
@@ -371,7 +371,7 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
                                               AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                               AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                               &pointerCoords, mXPrecision, mYPrecision,
                                               &pointerCoords, mXPrecision, mYPrecision,
                                               xCursorPosition, yCursorPosition, downTime,
                                               xCursorPosition, yCursorPosition, downTime,
                                               /* videoFrames */ {}));
                                               /*videoFrames=*/{}));
            }
            }
        }
        }


@@ -386,7 +386,7 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
                                           AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                           AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                           &pointerCoords, mXPrecision, mYPrecision,
                                           &pointerCoords, mXPrecision, mYPrecision,
                                           xCursorPosition, yCursorPosition, downTime,
                                           xCursorPosition, yCursorPosition, downTime,
                                           /* videoFrames */ {}));
                                           /*videoFrames=*/{}));
        }
        }


        // Send scroll events.
        // Send scroll events.
@@ -401,7 +401,7 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
                                           AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                           AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                           &pointerCoords, mXPrecision, mYPrecision,
                                           &pointerCoords, mXPrecision, mYPrecision,
                                           xCursorPosition, yCursorPosition, downTime,
                                           xCursorPosition, yCursorPosition, downTime,
                                           /* videoFrames */ {}));
                                           /*videoFrames=*/{}));
        }
        }
    }
    }


+1 −1
Original line number Original line Diff line number Diff line
@@ -352,7 +352,7 @@ std::list<NotifyArgs> JoystickInputMapper::sync(nsecs_t when, nsecs_t readTime,
                                   MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                   MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                   &pointerProperties, &pointerCoords, 0, 0,
                                   &pointerProperties, &pointerCoords, 0, 0,
                                   AMOTION_EVENT_INVALID_CURSOR_POSITION,
                                   AMOTION_EVENT_INVALID_CURSOR_POSITION,
                                   AMOTION_EVENT_INVALID_CURSOR_POSITION, 0, /* videoFrames */ {}));
                                   AMOTION_EVENT_INVALID_CURSOR_POSITION, 0, /*videoFrames=*/{}));
    return out;
    return out;
}
}


+2 −2
Original line number Original line Diff line number Diff line
@@ -148,10 +148,10 @@ std::list<NotifyArgs> RotaryEncoderInputMapper::sync(nsecs_t when, nsecs_t readT
        out.push_back(
        out.push_back(
                NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(), mSource,
                NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(), mSource,
                                 displayId, policyFlags, AMOTION_EVENT_ACTION_SCROLL, 0, 0,
                                 displayId, policyFlags, AMOTION_EVENT_ACTION_SCROLL, 0, 0,
                                 metaState, /* buttonState */ 0, MotionClassification::NONE,
                                 metaState, /*buttonState=*/0, MotionClassification::NONE,
                                 AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                 AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                 &pointerCoords, 0, 0, AMOTION_EVENT_INVALID_CURSOR_POSITION,
                                 &pointerCoords, 0, 0, AMOTION_EVENT_INVALID_CURSOR_POSITION,
                                 AMOTION_EVENT_INVALID_CURSOR_POSITION, 0, /* videoFrames */ {}));
                                 AMOTION_EVENT_INVALID_CURSOR_POSITION, 0, /*videoFrames=*/{}));
    }
    }


    mRotaryEncoderScrollAccumulator.finishSync();
    mRotaryEncoderScrollAccumulator.finishSync();
+9 −9
Original line number Original line Diff line number Diff line
@@ -2744,7 +2744,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerGestures(nsecs_t when, ns
                                       buttonState, MotionClassification::NONE,
                                       buttonState, MotionClassification::NONE,
                                       AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                       AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
                                       &pointerCoords, 0, 0, x, y, mPointerGesture.downTime,
                                       &pointerCoords, 0, 0, x, y, mPointerGesture.downTime,
                                       /* videoFrames */ {}));
                                       /*videoFrames=*/{}));
    }
    }


    // Update state.
    // Update state.
@@ -3643,7 +3643,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                       mOrientedXPrecision, mOrientedYPrecision,
                                       mOrientedXPrecision, mOrientedYPrecision,
                                       mPointerSimple.lastCursorX, mPointerSimple.lastCursorY,
                                       mPointerSimple.lastCursorX, mPointerSimple.lastCursorY,
                                       mPointerSimple.downTime,
                                       mPointerSimple.downTime,
                                       /* videoFrames */ {}));
                                       /*videoFrames=*/{}));
    }
    }


    if (mPointerSimple.hovering && !hovering) {
    if (mPointerSimple.hovering && !hovering) {
@@ -3658,7 +3658,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                 &mPointerSimple.lastCoords, mOrientedXPrecision,
                                 &mPointerSimple.lastCoords, mOrientedXPrecision,
                                 mOrientedYPrecision, mPointerSimple.lastCursorX,
                                 mOrientedYPrecision, mPointerSimple.lastCursorX,
                                 mPointerSimple.lastCursorY, mPointerSimple.downTime,
                                 mPointerSimple.lastCursorY, mPointerSimple.downTime,
                                 /* videoFrames */ {}));
                                 /*videoFrames=*/{}));
    }
    }


    if (down) {
    if (down) {
@@ -3675,7 +3675,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                           &mPointerSimple.currentProperties,
                                           &mPointerSimple.currentProperties,
                                           &mPointerSimple.currentCoords, mOrientedXPrecision,
                                           &mPointerSimple.currentCoords, mOrientedXPrecision,
                                           mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                           mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                           mPointerSimple.downTime, /* videoFrames */ {}));
                                           mPointerSimple.downTime, /*videoFrames=*/{}));
        }
        }


        // Send move.
        // Send move.
@@ -3686,7 +3686,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                       &mPointerSimple.currentProperties,
                                       &mPointerSimple.currentProperties,
                                       &mPointerSimple.currentCoords, mOrientedXPrecision,
                                       &mPointerSimple.currentCoords, mOrientedXPrecision,
                                       mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                       mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                       mPointerSimple.downTime, /* videoFrames */ {}));
                                       mPointerSimple.downTime, /*videoFrames=*/{}));
    }
    }


    if (hovering) {
    if (hovering) {
@@ -3702,7 +3702,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                           &mPointerSimple.currentProperties,
                                           &mPointerSimple.currentProperties,
                                           &mPointerSimple.currentCoords, mOrientedXPrecision,
                                           &mPointerSimple.currentCoords, mOrientedXPrecision,
                                           mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                           mOrientedYPrecision, cursorPosition.x, cursorPosition.y,
                                           mPointerSimple.downTime, /* videoFrames */ {}));
                                           mPointerSimple.downTime, /*videoFrames=*/{}));
        }
        }


        // Send hover move.
        // Send hover move.
@@ -3713,7 +3713,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                 MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                 MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
                                 &mPointerSimple.currentProperties, &mPointerSimple.currentCoords,
                                 &mPointerSimple.currentProperties, &mPointerSimple.currentCoords,
                                 mOrientedXPrecision, mOrientedYPrecision, cursorPosition.x,
                                 mOrientedXPrecision, mOrientedYPrecision, cursorPosition.x,
                                 cursorPosition.y, mPointerSimple.downTime, /* videoFrames */ {}));
                                 cursorPosition.y, mPointerSimple.downTime, /*videoFrames=*/{}));
    }
    }


    if (mCurrentRawState.rawVScroll || mCurrentRawState.rawHScroll) {
    if (mCurrentRawState.rawVScroll || mCurrentRawState.rawHScroll) {
@@ -3735,7 +3735,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerSimple(nsecs_t when, nsec
                                       &mPointerSimple.currentProperties, &pointerCoords,
                                       &mPointerSimple.currentProperties, &pointerCoords,
                                       mOrientedXPrecision, mOrientedYPrecision, cursorPosition.x,
                                       mOrientedXPrecision, mOrientedYPrecision, cursorPosition.x,
                                       cursorPosition.y, mPointerSimple.downTime,
                                       cursorPosition.y, mPointerSimple.downTime,
                                       /* videoFrames */ {}));
                                       /*videoFrames=*/{}));
    }
    }


    // Save state.
    // Save state.
@@ -3766,7 +3766,7 @@ std::list<NotifyArgs> TouchInputMapper::abortPointerSimple(nsecs_t when, nsecs_t
                                       mOrientedXPrecision, mOrientedYPrecision,
                                       mOrientedXPrecision, mOrientedYPrecision,
                                       mPointerSimple.lastCursorX, mPointerSimple.lastCursorY,
                                       mPointerSimple.lastCursorX, mPointerSimple.lastCursorY,
                                       mPointerSimple.downTime,
                                       mPointerSimple.downTime,
                                       /* videoFrames */ {}));
                                       /*videoFrames=*/{}));
        if (mPointerController != nullptr) {
        if (mPointerController != nullptr) {
            mPointerController->fade(PointerControllerInterface::Transition::GRADUAL);
            mPointerController->fade(PointerControllerInterface::Transition::GRADUAL);
        }
        }
Loading