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

Commit a1188f5b authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add eventTime print out to Entry dump

Add an eventtime printout for Entry dump. This helps when debugging some
input issues, especially related to batched consumption.

Bug: 160561987
Test: atest inputflinger_tests libinput_tests
Test: adb shell dumpsys input
Change-Id: I5eb3ce1a1ecc22719dd60c90c48021073cdf03f6
parent e0a064b6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -54,8 +54,12 @@ protected:
};

TEST_F(InputPublisherAndConsumerTest, GetChannel_ReturnsTheChannel) {
    ASSERT_NE(nullptr, mPublisher->getChannel());
    ASSERT_NE(nullptr, mConsumer->getChannel());
    EXPECT_EQ(mServerChannel.get(), mPublisher->getChannel().get());
    EXPECT_EQ(mClientChannel.get(), mConsumer->getChannel().get());
    ASSERT_EQ(mPublisher->getChannel()->getConnectionToken(),
              mConsumer->getChannel()->getConnectionToken());
}

void InputPublisherAndConsumerTest::PublishAndConsumeKeyEvent() {
+7 −5
Original line number Diff line number Diff line
@@ -151,11 +151,12 @@ std::string KeyEntry::getDescription() const {
    if (!GetBoolProperty("ro.debuggable", false)) {
        return "KeyEvent";
    }
    return StringPrintf("KeyEvent(deviceId=%d, source=0x%08x, displayId=%" PRId32 ", action=%s, "
    return StringPrintf("KeyEvent(deviceId=%d, eventTime=%" PRIu64
                        ", source=0x%08x, displayId=%" PRId32 ", action=%s, "
                        "flags=0x%08x, keyCode=%d, scanCode=%d, metaState=0x%08x, "
                        "repeatCount=%d), policyFlags=0x%08x",
                        deviceId, source, displayId, KeyEvent::actionToString(action), flags,
                        keyCode, scanCode, metaState, repeatCount, policyFlags);
                        deviceId, eventTime, source, displayId, KeyEvent::actionToString(action),
                        flags, keyCode, scanCode, metaState, repeatCount, policyFlags);
}

void KeyEntry::recycle() {
@@ -210,12 +211,13 @@ std::string MotionEntry::getDescription() const {
        return "MotionEvent";
    }
    std::string msg;
    msg += StringPrintf("MotionEvent(deviceId=%d, source=0x%08x, displayId=%" PRId32
    msg += StringPrintf("MotionEvent(deviceId=%d, eventTime=%" PRIu64
                        ", source=0x%08x, displayId=%" PRId32
                        ", action=%s, actionButton=0x%08x, flags=0x%08x, metaState=0x%08x, "
                        "buttonState=0x%08x, "
                        "classification=%s, edgeFlags=0x%08x, xPrecision=%.1f, yPrecision=%.1f, "
                        "xCursorPosition=%0.1f, yCursorPosition=%0.1f, pointers=[",
                        deviceId, source, displayId, MotionEvent::actionToString(action),
                        deviceId, eventTime, source, displayId, MotionEvent::actionToString(action),
                        actionButton, flags, metaState, buttonState,
                        motionClassificationToString(classification), edgeFlags, xPrecision,
                        yPrecision, xCursorPosition, yCursorPosition);