Skip to content

Commit c1044bb

Browse files
authored
Fix: PerformanceAndroidEventProcessor uses up to date isTracingEnabled set on Configuration callback (#1786)
1 parent 776d87c commit c1044bb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Feat: Add datasource tracing with P6Spy (#1784)
66
* Fix: ActivityFramesTracker does not throw if Activity has not been added (#1782)
7+
* Fix: PerformanceAndroidEventProcessor uses up to date isTracingEnabled set on Configuration callback (#1786)
78

89
## 5.2.4
910

sentry-android-core/src/main/java/io/sentry/android/core/PerformanceAndroidEventProcessor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@
1919
/** Event Processor responsible for adding Android metrics to transactions */
2020
final class PerformanceAndroidEventProcessor implements EventProcessor {
2121

22-
private final boolean tracingEnabled;
23-
2422
private boolean sentStartMeasurement = false;
2523

2624
private final @NotNull ActivityFramesTracker activityFramesTracker;
25+
private final @NotNull SentryAndroidOptions options;
2726

2827
PerformanceAndroidEventProcessor(
2928
final @NotNull SentryAndroidOptions options,
3029
final @NotNull ActivityFramesTracker activityFramesTracker) {
31-
tracingEnabled = options.isTracingEnabled();
30+
this.options = Objects.requireNonNull(options, "SentryAndroidOptions is required");
3231
this.activityFramesTracker =
3332
Objects.requireNonNull(activityFramesTracker, "ActivityFramesTracker is required");
3433
}
@@ -37,7 +36,7 @@ final class PerformanceAndroidEventProcessor implements EventProcessor {
3736
public synchronized @NotNull SentryTransaction process(
3837
@NotNull SentryTransaction transaction, @Nullable Object hint) {
3938

40-
if (!tracingEnabled) {
39+
if (!options.isTracingEnabled()) {
4140
return transaction;
4241
}
4342

0 commit comments

Comments
 (0)