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

Commit 5e95a700 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Android (Google) Code Review
Browse files

Merge changes I223071a2,I7dfe648c into main

* changes:
  Print Motion/KeyEvent's eventId as a hex string
  Increase the test timeout used when waiting for events to be traced
parents 5e8cb592 f5abab68
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -374,7 +374,7 @@ std::ostream& operator<<(std::ostream& out, const KeyEvent& event) {
    out << ", deviceId=" << event.getDeviceId();
    out << ", source=" << inputEventSourceToString(event.getSource());
    out << ", displayId=" << event.getDisplayId();
    out << ", eventId=" << event.getId();
    out << ", eventId=0x" << std::hex << event.getId() << std::dec;
    out << "}";
    return out;
}
@@ -1051,7 +1051,7 @@ std::ostream& operator<<(std::ostream& out, const MotionEvent& event) {
    out << ", deviceId=" << event.getDeviceId();
    out << ", source=" << inputEventSourceToString(event.getSource());
    out << ", displayId=" << event.getDisplayId();
    out << ", eventId=" << event.getId();
    out << ", eventId=0x" << std::hex << event.getId() << std::dec;
    out << "}";
    return out;
}
+5 −1
Original line number Diff line number Diff line
@@ -23,7 +23,11 @@ namespace android::inputdispatcher {

namespace {

constexpr auto TRACE_TIMEOUT = std::chrono::milliseconds(100);
// Use a larger timeout while waiting for events to be traced, compared to the timeout used while
// waiting to receive events through the input channel. Events are traced from a separate thread,
// which does not have the same high thread priority as the InputDispatcher's thread, so the tracer
// is expected to lag behind the Dispatcher at times.
constexpr auto TRACE_TIMEOUT = std::chrono::seconds(5);

base::ResultError<> error(const std::ostringstream& ss) {
    return base::ResultError(ss.str(), BAD_VALUE);