Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ed05c99 authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Load the viewer config in a background thread to minimize performance impact on process boot time

Bug: 354357871
Test: BootTimeTest.BootTimeTest#SuccessiveBootTest
Flag: android.tracing.perfetto_protolog_tracing
Change-Id: I9e06994a743acedb6f28bc4578d21856603bd803
parent d5fb3067
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -317,7 +317,11 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto
        }

        if (mViewerConfigReader != null) {
            mViewerConfigReader.loadViewerConfig(groupsLoggingToLogcat.toArray(new String[0]));
            // Load in background to avoid delay in boot process.
            // The caveat is that any log message that is also logged to logcat will not be
            // successfully decoded until this completes.
            mBackgroundLoggingService.execute(() -> mViewerConfigReader
                    .loadViewerConfig(groupsLoggingToLogcat.toArray(new String[0])));
        }
    }