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

Commit 0164277c authored by Harry Cutts's avatar Harry Cutts Committed by Automerger Merge Worker
Browse files

Merge "libs/input: make parameter comment style consistent" into udc-dev am:...

Merge "libs/input: make parameter comment style consistent" into udc-dev am: 3fcbed1e am: c33d6aa6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/21956298



Change-Id: If1cecd0923f0c781dff890e5585cb4210d296336
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents db1a1d0e c33d6aa6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -43,13 +43,13 @@ const struct timeval& TouchVideoFrame::getTimestamp() const { return mTimestamp;
void TouchVideoFrame::rotate(ui::Rotation orientation) {
    switch (orientation) {
        case ui::ROTATION_90:
            rotateQuarterTurn(false /*clockwise*/);
            rotateQuarterTurn(/*clockwise=*/false);
            break;
        case ui::ROTATION_180:
            rotate180();
            break;
        case ui::ROTATION_270:
            rotateQuarterTurn(true /*clockwise*/);
            rotateQuarterTurn(/*clockwise=*/true);
            break;
        case ui::ROTATION_0:
            // No need to rotate if there's no rotation.
+6 −6
Original line number Diff line number Diff line
@@ -159,10 +159,10 @@ void VelocityTracker::configureStrategy(int32_t axis) {

    std::unique_ptr<VelocityTrackerStrategy> createdStrategy;
    if (mOverrideStrategy != VelocityTracker::Strategy::DEFAULT) {
        createdStrategy = createStrategy(mOverrideStrategy, isDifferentialAxis /* deltaValues */);
        createdStrategy = createStrategy(mOverrideStrategy, /*deltaValues=*/isDifferentialAxis);
    } else {
        createdStrategy = createStrategy(DEFAULT_STRATEGY_BY_AXIS.at(axis),
                                         isDifferentialAxis /* deltaValues */);
                                         /*deltaValues=*/isDifferentialAxis);
    }

    LOG_ALWAYS_FATAL_IF(createdStrategy == nullptr,
@@ -488,7 +488,7 @@ static std::optional<float> solveLeastSquares(const std::vector<float>& x,
    }

    ALOGD_IF(DEBUG_STRATEGY, "  - a=%s",
             matrixToString(&a[0][0], m, n, false /*rowMajor*/).c_str());
             matrixToString(&a[0][0], m, n, /*rowMajor=*/false).c_str());

    // Apply the Gram-Schmidt process to A to obtain its QR decomposition.
    float q[n][m]; // orthonormal basis, column-major order
@@ -520,8 +520,8 @@ static std::optional<float> solveLeastSquares(const std::vector<float>& x,
        }
    }
    if (DEBUG_STRATEGY) {
        ALOGD("  - q=%s", matrixToString(&q[0][0], m, n, false /*rowMajor*/).c_str());
        ALOGD("  - r=%s", matrixToString(&r[0][0], n, n, true /*rowMajor*/).c_str());
        ALOGD("  - q=%s", matrixToString(&q[0][0], m, n, /*rowMajor=*/false).c_str());
        ALOGD("  - r=%s", matrixToString(&r[0][0], n, n, /*rowMajor=*/true).c_str());

        // calculate QR, if we factored A correctly then QR should equal A
        float qr[n][m];
@@ -533,7 +533,7 @@ static std::optional<float> solveLeastSquares(const std::vector<float>& x,
                }
            }
        }
        ALOGD("  - qr=%s", matrixToString(&qr[0][0], m, n, false /*rowMajor*/).c_str());
        ALOGD("  - qr=%s", matrixToString(&qr[0][0], m, n, /*rowMajor=*/false).c_str());
    }

    // Solve R B = Qt W Y to find B.  This is easy because R is upper triangular.
+14 −14
Original line number Diff line number Diff line
@@ -531,7 +531,7 @@ TEST_F(MotionEventTest, CopyFrom_KeepHistory) {
    initializeEventWithHistory(&event);

    MotionEvent copy;
    copy.copyFrom(&event, true /*keepHistory*/);
    copy.copyFrom(&event, /*keepHistory=*/true);

    ASSERT_NO_FATAL_FAILURE(assertEqualsEventWithHistory(&event));
}
@@ -541,7 +541,7 @@ TEST_F(MotionEventTest, CopyFrom_DoNotKeepHistory) {
    initializeEventWithHistory(&event);

    MotionEvent copy;
    copy.copyFrom(&event, false /*keepHistory*/);
    copy.copyFrom(&event, /*keepHistory=*/false);

    ASSERT_EQ(event.getPointerCount(), copy.getPointerCount());
    ASSERT_EQ(0U, copy.getHistorySize());
@@ -642,12 +642,12 @@ TEST_F(MotionEventTest, Transform) {
    }
    MotionEvent event;
    ui::Transform identityTransform;
    event.initialize(InputEvent::nextId(), 0 /*deviceId*/, AINPUT_SOURCE_TOUCHSCREEN, DISPLAY_ID,
                     INVALID_HMAC, AMOTION_EVENT_ACTION_MOVE, 0 /*actionButton*/, 0 /*flags*/,
                     AMOTION_EVENT_EDGE_FLAG_NONE, AMETA_NONE, 0 /*buttonState*/,
                     MotionClassification::NONE, identityTransform, 0 /*xPrecision*/,
                     0 /*yPrecision*/, 3 + RADIUS /*xCursorPosition*/, 2 /*yCursorPosition*/,
                     identityTransform, 0 /*downTime*/, 0 /*eventTime*/, pointerCount,
    event.initialize(InputEvent::nextId(), /*deviceId=*/0, AINPUT_SOURCE_TOUCHSCREEN, DISPLAY_ID,
                     INVALID_HMAC, AMOTION_EVENT_ACTION_MOVE, /*actionButton=*/0, /*flags=*/0,
                     AMOTION_EVENT_EDGE_FLAG_NONE, AMETA_NONE, /*buttonState=*/0,
                     MotionClassification::NONE, identityTransform, /*xPrecision=*/0,
                     /*yPrecision=*/0, /*xCursorPosition=*/3 + RADIUS, /*yCursorPosition=*/2,
                     identityTransform, /*downTime=*/0, /*eventTime=*/0, pointerCount,
                     pointerProperties, pointerCoords);
    float originalRawX = 0 + 3;
    float originalRawY = -RADIUS + 2;
@@ -848,12 +848,12 @@ TEST_F(MotionEventTest, Initialize_SetsClassification) {

    ui::Transform identityTransform;
    for (MotionClassification classification : classifications) {
        event.initialize(InputEvent::nextId(), 0 /*deviceId*/, AINPUT_SOURCE_TOUCHSCREEN,
        event.initialize(InputEvent::nextId(), /*deviceId=*/0, AINPUT_SOURCE_TOUCHSCREEN,
                         DISPLAY_ID, INVALID_HMAC, AMOTION_EVENT_ACTION_DOWN, 0, 0,
                         AMOTION_EVENT_EDGE_FLAG_NONE, AMETA_NONE, 0, classification,
                         identityTransform, 0, 0, AMOTION_EVENT_INVALID_CURSOR_POSITION,
                         AMOTION_EVENT_INVALID_CURSOR_POSITION, identityTransform, 0 /*downTime*/,
                         0 /*eventTime*/, pointerCount, pointerProperties, pointerCoords);
                         AMOTION_EVENT_INVALID_CURSOR_POSITION, identityTransform, /*downTime=*/0,
                         /*eventTime=*/0, pointerCount, pointerProperties, pointerCoords);
        ASSERT_EQ(classification, event.getClassification());
    }
}
@@ -870,11 +870,11 @@ TEST_F(MotionEventTest, Initialize_SetsCursorPosition) {
    }

    ui::Transform identityTransform;
    event.initialize(InputEvent::nextId(), 0 /*deviceId*/, AINPUT_SOURCE_MOUSE, DISPLAY_ID,
    event.initialize(InputEvent::nextId(), /*deviceId=*/0, AINPUT_SOURCE_MOUSE, DISPLAY_ID,
                     INVALID_HMAC, AMOTION_EVENT_ACTION_DOWN, 0, 0, AMOTION_EVENT_EDGE_FLAG_NONE,
                     AMETA_NONE, 0, MotionClassification::NONE, identityTransform, 0, 0,
                     280 /*xCursorPosition*/, 540 /*yCursorPosition*/, identityTransform,
                     0 /*downTime*/, 0 /*eventTime*/, pointerCount, pointerProperties,
                     /*xCursorPosition=*/280, /*yCursorPosition=*/540, identityTransform,
                     /*downTime=*/0, /*eventTime=*/0, pointerCount, pointerProperties,
                     pointerCoords);
    event.offsetLocation(20, 60);
    ASSERT_EQ(280, event.getRawXCursorPosition());
+6 −6
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeKeyEvent() {

    uint32_t consumeSeq;
    InputEvent* event;
    status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, -1, &consumeSeq, &event);
    status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, -1, &consumeSeq, &event);
    ASSERT_EQ(OK, status)
            << "consumer consume should return OK";

@@ -201,7 +201,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeMotionEvent() {

    uint32_t consumeSeq;
    InputEvent* event;
    status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, -1, &consumeSeq, &event);
    status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, -1, &consumeSeq, &event);
    ASSERT_EQ(OK, status)
            << "consumer consume should return OK";

@@ -294,7 +294,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeFocusEvent() {

    uint32_t consumeSeq;
    InputEvent* event;
    status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, -1, &consumeSeq, &event);
    status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, -1, &consumeSeq, &event);
    ASSERT_EQ(OK, status) << "consumer consume should return OK";

    ASSERT_TRUE(event != nullptr) << "consumer should have returned non-NULL event";
@@ -335,7 +335,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeCaptureEvent() {

    uint32_t consumeSeq;
    InputEvent* event;
    status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, -1, &consumeSeq, &event);
    status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, -1, &consumeSeq, &event);
    ASSERT_EQ(OK, status) << "consumer consume should return OK";

    ASSERT_TRUE(event != nullptr) << "consumer should have returned non-NULL event";
@@ -377,7 +377,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeDragEvent() {

    uint32_t consumeSeq;
    InputEvent* event;
    status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, -1, &consumeSeq, &event);
    status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, -1, &consumeSeq, &event);
    ASSERT_EQ(OK, status) << "consumer consume should return OK";

    ASSERT_TRUE(event != nullptr) << "consumer should have returned non-NULL event";
@@ -419,7 +419,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeTouchModeEvent() {

    uint32_t consumeSeq;
    InputEvent* event;
    status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, -1, &consumeSeq, &event);
    status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, -1, &consumeSeq, &event);
    ASSERT_EQ(OK, status) << "consumer consume should return OK";

    ASSERT_TRUE(event != nullptr) << "consumer should have returned non-NULL event";
+7 −7
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ protected:

        mPublisher = std::make_unique<InputPublisher>(std::move(serverChannel));
        mConsumer = std::make_unique<InputConsumer>(std::move(clientChannel),
                                                    true /* enableTouchResampling */);
                                                    /*enableTouchResampling=*/true);
    }

    status_t publishSimpleMotionEventWithCoords(int32_t action, nsecs_t eventTime,
@@ -79,11 +79,11 @@ status_t TouchResamplingTest::publishSimpleMotionEventWithCoords(
    if (action == AMOTION_EVENT_ACTION_DOWN && eventTime != 0) {
        ADD_FAILURE() << "Downtime should be equal to 0 (hardcoded for convenience)";
    }
    return mPublisher->publishMotionEvent(mSeq++, InputEvent::nextId(), 1 /*deviceId*/,
                                          AINPUT_SOURCE_TOUCHSCREEN, 0 /*displayId*/, INVALID_HMAC,
                                          action, 0 /*actionButton*/, 0 /*flags*/, 0 /*edgeFlags*/,
                                          AMETA_NONE, 0 /*buttonState*/, MotionClassification::NONE,
                                          identityTransform, 0 /*xPrecision*/, 0 /*yPrecision*/,
    return mPublisher->publishMotionEvent(mSeq++, InputEvent::nextId(), /*deviceId=*/1,
                                          AINPUT_SOURCE_TOUCHSCREEN, /*displayId=*/0, INVALID_HMAC,
                                          action, /*actionButton=*/0, /*flags=*/0, /*edgeFlags=*/0,
                                          AMETA_NONE, /*buttonState=*/0, MotionClassification::NONE,
                                          identityTransform, /*xPrecision=*/0, /*yPrecision=*/0,
                                          AMOTION_EVENT_INVALID_CURSOR_POSITION,
                                          AMOTION_EVENT_INVALID_CURSOR_POSITION, identityTransform,
                                          downTime, eventTime, properties.size(), properties.data(),
@@ -161,7 +161,7 @@ void TouchResamplingTest::consumeInputEventEntries(const std::vector<InputEventE
    uint32_t consumeSeq;
    InputEvent* event;

    status_t status = mConsumer->consume(&mEventFactory, true /*consumeBatches*/, frameTime.count(),
    status_t status = mConsumer->consume(&mEventFactory, /*consumeBatches=*/true, frameTime.count(),
                                         &consumeSeq, &event);
    ASSERT_EQ(OK, status);
    MotionEvent* motionEvent = static_cast<MotionEvent*>(event);
Loading