Save existing temporary traces on reboot

This change modifies PerfettoUtils to save in-progress traces found
after boot (instead of deleting them). This is intended to help debug
issues that may have caused the device to shut down.

In-progress traces found on reboot will only be saved properly if
Traceur is configured to capture long traces. This is because long
traces write data directly to disk, while normal traces do not. In
addition, traces recovered in this way may be incomplete--for example,
process IDs are saved and viewable in the Perfetto UI, but process names
are missing.

Test: Check that long traces started before a manual reboot are saved at
      /data/local/traces/recovered-trace-[info].perfetto-trace, and that
      this file can be opened in the Perfetto UI (ui.perfetto.dev).
Bug: 258261969
Change-Id: If91b040e154242cd790f2f26cfaf1329943590f4
2 files changed