InputTracer: Adjust sensitivity based on IME connection

Based on the trace rules, we can adjust the trace level depending on
when there was an active IME connection when the event processing was
complete.

Bug: 210460522
Test: manual with perfetto
Change-Id: I90587c3004fa05517cf44c4c0b6b5c5c40fc00d1
diff --git a/services/inputflinger/dispatcher/trace/InputTracer.h b/services/inputflinger/dispatcher/trace/InputTracer.h
index 717bc1f..dfaf7c3 100644
--- a/services/inputflinger/dispatcher/trace/InputTracer.h
+++ b/services/inputflinger/dispatcher/trace/InputTracer.h
@@ -48,9 +48,13 @@
     std::unique_ptr<EventTrackerInterface> traceDerivedEvent(const EventEntry&,
                                                              const EventTrackerInterface&) override;
     void traceEventDispatch(const DispatchEntry&, const EventTrackerInterface&) override;
+    void setInputMethodConnectionIsActive(bool isActive) override {
+        mIsImeConnectionActive = isActive;
+    }
 
 private:
     std::unique_ptr<InputTracingBackendInterface> mBackend;
+    bool mIsImeConnectionActive{false};
 
     // The state of a tracked event, shared across all events derived from the original event.
     struct EventState {
@@ -68,6 +72,7 @@
         bool isSecure{false};
         // The list of all possible UIDs that this event could be targeting.
         std::set<gui::Uid> targets;
+        bool isImeConnectionActive{false};
     };
 
     // Get the event state associated with a tracking cookie.