InputTracer: Separate the threading logic into a wrapper backend
InputTracer writes to the tracing backend interface. However, since perfetto expects events to be written from a single thread, InputTracer would write the events from a separate thread. To simplify the logic inside InputTracer, remove the threading logic. Instead, we introduce the ThreadingBackend class, which wraps around an abitrary backend and forwards events to the inner backend from a new thread. Another benefit of this is that we no longer have to use the threaded backend for tests, which makes the tracing part of InputDispatcher_test deterministic. Bug: 210460522 Test: atest inputflinger_tests Change-Id: If7bbc912c05bc975ec9585f0a0ebce68683925bb
Loading
Please register or sign in to comment