Create a default listener to collect UI traces on tests
Since UI traces have been moved to perfetto, they are no longer collected by default in userdebug builds in the lab.
To allow lab tests to easily collect UI traces with a default configuration (as before) create a new metrics collector that starts and stops perfetto based on a default config.
Note:
- the listener has to pass the configuration as a command line argument because without root access (e.g. CTS) the test is unable to create a perfetto configuration file in `/data/misc/perfetto-config`
Bug: 315865546
Test: atest ui-trace-collector-test:DefaultUITraceListenerTest --rerun-until-failure 100
Change-Id: I074c7e388ed0946941de73a078c5d1173e9363e8
11 files changed