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

Commit 5a8186c4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "perfetto-input-event-proto" into main

* changes:
  InputTracer: Trace an event being dispatched to a window
  InputTracer: Trace motion and key events
  InputTracer: Add custom key and motion event types for tracing
parents 8b0f2a20 adc59b44
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -28,6 +28,13 @@ flag {
  bug: "297192727"
 }

 flag {
  name: "enable_input_event_tracing"
  namespace: "input"
  description: "Set to true to enable input event tracing, including always-on tracing on non-user builds"
  bug: "210460522"
}

flag {
  name: "enable_multi_device_input"
  namespace: "input"
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ cc_defaults {
    ],
    static_libs: [
        "libattestation",
        "libperfetto_client_experimental",
        "libpalmrejection",
        "libui-types",
    ],
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ filegroup {
        "Monitor.cpp",
        "TouchedWindow.cpp",
        "TouchState.cpp",
        "trace/*.cpp",
    ],
}

@@ -72,6 +73,7 @@ cc_defaults {
    static_libs: [
        "libattestation",
        "libgui_window_info_static",
        "libperfetto_client_experimental",
    ],
    target: {
        android: {
+6 −2
Original line number Diff line number Diff line
@@ -284,7 +284,8 @@ volatile int32_t DispatchEntry::sNextSeqAtomic;
DispatchEntry::DispatchEntry(std::shared_ptr<const EventEntry> eventEntry,
                             ftl::Flags<InputTarget::Flags> targetFlags,
                             const ui::Transform& transform, const ui::Transform& rawTransform,
                             float globalScaleFactor)
                             float globalScaleFactor, gui::Uid targetUid, int64_t vsyncId,
                             std::optional<int32_t> windowId)
      : seq(nextSeq()),
        eventEntry(std::move(eventEntry)),
        targetFlags(targetFlags),
@@ -292,7 +293,10 @@ DispatchEntry::DispatchEntry(std::shared_ptr<const EventEntry> eventEntry,
        rawTransform(rawTransform),
        globalScaleFactor(globalScaleFactor),
        deliveryTime(0),
        resolvedFlags(0) {
        resolvedFlags(0),
        targetUid(targetUid),
        vsyncId(vsyncId),
        windowId(windowId) {
    switch (this->eventEntry->type) {
        case EventEntry::Type::KEY: {
            const KeyEntry& keyEntry = static_cast<const KeyEntry&>(*this->eventEntry);
+11 −1
Original line number Diff line number Diff line
@@ -227,9 +227,19 @@ struct DispatchEntry {

    int32_t resolvedFlags;

    // Information about the dispatch window used for tracing. We avoid holding a window handle
    // here because information in a window handle may be dynamically updated within the lifespan
    // of this dispatch entry.
    gui::Uid targetUid;
    int64_t vsyncId;
    // The window that this event is targeting. The only case when this windowId is not populated
    // is when dispatching an event to a global monitor.
    std::optional<int32_t> windowId;

    DispatchEntry(std::shared_ptr<const EventEntry> eventEntry,
                  ftl::Flags<InputTarget::Flags> targetFlags, const ui::Transform& transform,
                  const ui::Transform& rawTransform, float globalScaleFactor);
                  const ui::Transform& rawTransform, float globalScaleFactor, gui::Uid targetUid,
                  int64_t vsyncId, std::optional<int32_t> windowId);
    DispatchEntry(const DispatchEntry&) = delete;
    DispatchEntry& operator=(const DispatchEntry&) = delete;

Loading