Skip to content

Commit

Permalink
Fix autoPerformanceTracingEnabled flag in andorid plugin (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase authored Sep 12, 2023
1 parent 5aa047a commit d53c6fa
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

private var activity: WeakReference<Activity>? = null
private var framesTracker: ActivityFramesTracker? = null
private var autoPerformanceTracingEnabled = false

override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
context = flutterPluginBinding.applicationContext
Expand Down Expand Up @@ -137,7 +136,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
}

private fun fetchNativeAppStart(result: Result) {
if (!autoPerformanceTracingEnabled) {
if (!sentryFlutter.autoPerformanceTracingEnabled) {
result.success(null)
return
}
Expand All @@ -161,7 +160,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
}

private fun beginNativeFrames(result: Result) {
if (!autoPerformanceTracingEnabled) {
if (!sentryFlutter.autoPerformanceTracingEnabled) {
result.success(null)
return
}
Expand All @@ -174,7 +173,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

private fun endNativeFrames(id: String?, result: Result) {
val activity = activity?.get()
if (!autoPerformanceTracingEnabled || activity == null || id == null) {
if (!sentryFlutter.autoPerformanceTracingEnabled || activity == null || id == null) {
if (id == null) {
Log.w("Sentry", "Parameter id cannot be null when calling endNativeFrames.")
}
Expand Down

0 comments on commit d53c6fa

Please sign in to comment.