Notify onTraceStart listeners after providers
Summary:
I can't find any reason to prefer listeners over providers.
Given the uncontrolled effects this can have on init time, it seems prudent to make sure our trace is initialized before executing random work.
@@ -401,13 +401,13 @@ public final class TraceOrchestrator
providers = mNormalTraceProviders;
}
- mListenerManager.onTraceStart(context);
-
for (BaseTraceProvider provider : providers) {
provider.onEnable(context, this);
}
mListenerManager.onProvidersInitialized(context);
+ mListenerManager.onTraceStart(context);
+
synchronized (mTraceIdToContext) {
mTraceIdToContext.put(context.traceId, context);
}
