|
16 | 16 | import io.sentry.NoOpCompositePerformanceCollector; |
17 | 17 | import io.sentry.NoOpConnectionStatusProvider; |
18 | 18 | import io.sentry.NoOpContinuousProfiler; |
| 19 | +import io.sentry.NoOpReplayBreadcrumbConverter; |
19 | 20 | import io.sentry.NoOpSocketTagger; |
20 | 21 | import io.sentry.NoOpTransactionProfiler; |
21 | 22 | import io.sentry.NoopVersionDetector; |
@@ -145,21 +146,24 @@ static void initializeIntegrationsAndProcessors( |
145 | 146 | final @NotNull SentryAndroidOptions options, |
146 | 147 | final @NotNull Context context, |
147 | 148 | final @NotNull io.sentry.util.LoadClass loadClass, |
148 | | - final @NotNull ActivityFramesTracker activityFramesTracker) { |
| 149 | + final @NotNull ActivityFramesTracker activityFramesTracker, |
| 150 | + final boolean isReplayAvailable) { |
149 | 151 | initializeIntegrationsAndProcessors( |
150 | 152 | options, |
151 | 153 | context, |
152 | 154 | new BuildInfoProvider(new AndroidLogger()), |
153 | 155 | loadClass, |
154 | | - activityFramesTracker); |
| 156 | + activityFramesTracker, |
| 157 | + isReplayAvailable); |
155 | 158 | } |
156 | 159 |
|
157 | 160 | static void initializeIntegrationsAndProcessors( |
158 | 161 | final @NotNull SentryAndroidOptions options, |
159 | 162 | final @NotNull Context context, |
160 | 163 | final @NotNull BuildInfoProvider buildInfoProvider, |
161 | 164 | final @NotNull io.sentry.util.LoadClass loadClass, |
162 | | - final @NotNull ActivityFramesTracker activityFramesTracker) { |
| 165 | + final @NotNull ActivityFramesTracker activityFramesTracker, |
| 166 | + final boolean isReplayAvailable) { |
163 | 167 |
|
164 | 168 | if (options.getCacheDirPath() != null |
165 | 169 | && options.getEnvelopeDiskCache() instanceof NoOpEnvelopeCache) { |
@@ -253,6 +257,14 @@ static void initializeIntegrationsAndProcessors( |
253 | 257 | options.setCompositePerformanceCollector(new DefaultCompositePerformanceCollector(options)); |
254 | 258 | } |
255 | 259 |
|
| 260 | + if (isReplayAvailable |
| 261 | + && options.getReplayController().getBreadcrumbConverter() |
| 262 | + instanceof NoOpReplayBreadcrumbConverter) { |
| 263 | + options |
| 264 | + .getReplayController() |
| 265 | + .setBreadcrumbConverter(new DefaultReplayBreadcrumbConverter(options)); |
| 266 | + } |
| 267 | + |
256 | 268 | // Check if the profiler was already instantiated in the app start. |
257 | 269 | // We use the Android profiler, that uses a global start/stop api, so we need to preserve the |
258 | 270 | // state of the profiler, and it's only possible retaining the instance. |
@@ -406,7 +418,6 @@ static void installDefaultIntegrations( |
406 | 418 | if (isReplayAvailable) { |
407 | 419 | final ReplayIntegration replay = |
408 | 420 | new ReplayIntegration(context, CurrentDateProvider.getInstance()); |
409 | | - replay.setBreadcrumbConverter(new DefaultReplayBreadcrumbConverter()); |
410 | 421 | options.addIntegration(replay); |
411 | 422 | options.setReplayController(replay); |
412 | 423 | } |
|
0 commit comments