InputTracer: Introduce TracedEventArgs to track secure events

Introduce TracedEventArgs to give the tracing backend additional
information about the traced event.

We start by tracking whether an event is secure. An event is marked as
secure if it is targeting at least one secure window.

For now, do not trace secure events in the perfetto backend.

Bug: 210460522
Test: manual with perfetto
Change-Id: I41648d769319e47486556d0a2d6b8f02142048d2
diff --git a/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h b/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h
index 94a86b9..865e827 100644
--- a/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h
+++ b/services/inputflinger/dispatcher/trace/InputTracingBackendInterface.h
@@ -74,6 +74,12 @@
 /** A representation of a traced input event. */
 using TracedEvent = std::variant<TracedKeyEvent, TracedMotionEvent>;
 
+/** Additional information about an input event being traced. */
+struct TracedEventArgs {
+    // True if the event is targeting at least one secure window.
+    bool isSecure;
+};
+
 /**
  * An interface for the tracing backend, used for setting a custom backend for testing.
  */
@@ -82,10 +88,10 @@
     virtual ~InputTracingBackendInterface() = default;
 
     /** Trace a KeyEvent. */
-    virtual void traceKeyEvent(const TracedKeyEvent&) = 0;
+    virtual void traceKeyEvent(const TracedKeyEvent&, const TracedEventArgs&) = 0;
 
     /** Trace a MotionEvent. */
-    virtual void traceMotionEvent(const TracedMotionEvent&) = 0;
+    virtual void traceMotionEvent(const TracedMotionEvent&, const TracedEventArgs&) = 0;
 
     /** Trace an event being sent to a window. */
     struct WindowDispatchArgs {
@@ -100,7 +106,7 @@
         std::array<uint8_t, 32> hmac;
         int32_t resolvedKeyRepeatCount;
     };
-    virtual void traceWindowDispatch(const WindowDispatchArgs&) = 0;
+    virtual void traceWindowDispatch(const WindowDispatchArgs&, const TracedEventArgs&) = 0;
 };
 
 } // namespace android::inputdispatcher::trace