Skip to content

Commit d53c6fa

Browse files
authored
Fix autoPerformanceTracingEnabled flag in andorid plugin (#1640)
1 parent 5aa047a commit d53c6fa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
4040

4141
private var activity: WeakReference<Activity>? = null
4242
private var framesTracker: ActivityFramesTracker? = null
43-
private var autoPerformanceTracingEnabled = false
4443

4544
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
4645
context = flutterPluginBinding.applicationContext
@@ -137,7 +136,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
137136
}
138137

139138
private fun fetchNativeAppStart(result: Result) {
140-
if (!autoPerformanceTracingEnabled) {
139+
if (!sentryFlutter.autoPerformanceTracingEnabled) {
141140
result.success(null)
142141
return
143142
}
@@ -161,7 +160,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
161160
}
162161

163162
private fun beginNativeFrames(result: Result) {
164-
if (!autoPerformanceTracingEnabled) {
163+
if (!sentryFlutter.autoPerformanceTracingEnabled) {
165164
result.success(null)
166165
return
167166
}
@@ -174,7 +173,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
174173

175174
private fun endNativeFrames(id: String?, result: Result) {
176175
val activity = activity?.get()
177-
if (!autoPerformanceTracingEnabled || activity == null || id == null) {
176+
if (!sentryFlutter.autoPerformanceTracingEnabled || activity == null || id == null) {
178177
if (id == null) {
179178
Log.w("Sentry", "Parameter id cannot be null when calling endNativeFrames.")
180179
}

0 commit comments

Comments
 (0)