use of com.google.firebase.perf.metrics.AppStartTrace in project firebase-android-sdk by firebase.
the class FirebasePerfProvider method attachInfo.
@Override
public void attachInfo(Context context, ProviderInfo info) {
// super.attachInfo calls onCreate(). Fail as early as possible.
checkContentProviderAuthority(info);
super.attachInfo(context, info);
// Initialize ConfigResolver early for accessing device caching layer.
ConfigResolver configResolver = ConfigResolver.getInstance();
configResolver.setContentProviderContext(getContext());
AppStateMonitor appStateMonitor = AppStateMonitor.getInstance();
appStateMonitor.registerActivityLifecycleCallbacks(getContext());
appStateMonitor.registerForAppColdStart(new FirebasePerformanceInitializer());
AppStartTrace appStartTrace = AppStartTrace.getInstance();
appStartTrace.registerActivityLifecycleCallbacks(getContext());
mainHandler.post(new AppStartTrace.StartFromBackgroundRunnable(appStartTrace));
// In the case of cold start, we create a session and start collecting gauges as early as
// possible.
// There is code in SessionManager that prevents us from resetting the session twice in case
// of app cold start.
SessionManager.getInstance().initializeGaugeCollection();
}
Aggregations