@@ -68,7 +68,6 @@ public class AppStartTrace implements ActivityLifecycleCallbacks {
6868 private static final int CORE_POOL_SIZE = 0 ;
6969 private static final int MAX_POOL_SIZE = 1 ; // Only need single thread
7070
71- private static volatile AppStartTrace instance ;
7271 private static ExecutorService executorService ;
7372
7473 private boolean isRegisteredForLifecycleCallbacks = false ;
@@ -129,29 +128,17 @@ public static void setLauncherActivityOnResumeTime(String activity) {
129128 // no-op, for backward compatibility with old version plugin.
130129 }
131130
132- public static AppStartTrace getInstance () {
133- return instance != null ? instance : getInstance (TransportManager .getInstance (), new Clock ());
134- }
135-
136- static AppStartTrace getInstance (TransportManager transportManager , Clock clock ) {
137- if (instance == null ) {
138- synchronized (AppStartTrace .class ) {
139- if (instance == null ) {
140- instance =
141- new AppStartTrace (
142- transportManager ,
143- clock ,
144- ConfigResolver .getInstance (),
145- new ThreadPoolExecutor (
146- CORE_POOL_SIZE ,
147- MAX_POOL_SIZE ,
148- /* keepAliveTime= */ MAX_LATENCY_BEFORE_UI_INIT + 10 ,
149- TimeUnit .SECONDS ,
150- new LinkedBlockingQueue <>()));
151- }
152- }
153- }
154- return instance ;
131+ public AppStartTrace () {
132+ this (
133+ TransportManager .getInstance (),
134+ new Clock (),
135+ ConfigResolver .getInstance (),
136+ new ThreadPoolExecutor (
137+ CORE_POOL_SIZE ,
138+ MAX_POOL_SIZE ,
139+ /* keepAliveTime= */ MAX_LATENCY_BEFORE_UI_INIT + 10 ,
140+ TimeUnit .SECONDS ,
141+ new LinkedBlockingQueue <>()));
155142 }
156143
157144 AppStartTrace (
0 commit comments