From 07eee641e9ec1a0eb163d58b7cb5e99e845657b3 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 13 May 2026 11:45:49 +1200 Subject: [PATCH 1/3] feat(android): expose tombstone options on Native options Adds TombstoneEnabled and ReportHistoricalTombstones to SentryOptions.NativeOptions and bindable Android native options, then maps them to SentryAndroidOptions. Closes #5027 Co-Authored-By: Justice --- .../Platforms/Android/BindableNativeSentryOptions.cs | 4 ++++ src/Sentry/Platforms/Android/NativeOptions.cs | 12 ++++++++++++ src/Sentry/Platforms/Android/SentrySdk.cs | 2 ++ 3 files changed, 18 insertions(+) diff --git a/src/Sentry/Platforms/Android/BindableNativeSentryOptions.cs b/src/Sentry/Platforms/Android/BindableNativeSentryOptions.cs index e8ce8b4444..1ceb8a6ec0 100644 --- a/src/Sentry/Platforms/Android/BindableNativeSentryOptions.cs +++ b/src/Sentry/Platforms/Android/BindableNativeSentryOptions.cs @@ -34,6 +34,8 @@ public class NativeOptions public bool? PrintUncaughtStackTrace { get; set; } public double? ProfilesSampleRate { get; set; } public TimeSpan? ReadTimeout { get; set; } + public bool? TombstoneEnabled { get; set; } + public bool? ReportHistoricalTombstones { get; set; } public bool? EnableTracing { get; set; } public bool? EnableBeforeSend { get; set; } @@ -77,6 +79,8 @@ public void ApplyTo(SentryOptions.NativeOptions options) options.PrintUncaughtStackTrace = PrintUncaughtStackTrace ?? options.PrintUncaughtStackTrace; options.ProfilesSampleRate = ProfilesSampleRate ?? options.ProfilesSampleRate; options.ReadTimeout = ReadTimeout ?? options.ReadTimeout; + options.TombstoneEnabled = TombstoneEnabled ?? options.TombstoneEnabled; + options.ReportHistoricalTombstones = ReportHistoricalTombstones ?? options.ReportHistoricalTombstones; options.EnableTracing = EnableTracing ?? options.EnableTracing; options.EnableBeforeSend = EnableBeforeSend ?? options.EnableBeforeSend; diff --git a/src/Sentry/Platforms/Android/NativeOptions.cs b/src/Sentry/Platforms/Android/NativeOptions.cs index eacad17cb9..78fbf72d66 100644 --- a/src/Sentry/Platforms/Android/NativeOptions.cs +++ b/src/Sentry/Platforms/Android/NativeOptions.cs @@ -207,6 +207,18 @@ internal NativeOptions(SentryOptions options) /// public TimeSpan ReadTimeout { get; set; } = TimeSpan.FromSeconds(5); + /// + /// Gets or sets a value that indicates if native crash reporting via tombstones is enabled. + /// The default value is true (enabled). + /// + public bool TombstoneEnabled { get; set; } = true; + + /// + /// Gets or sets a value that indicates if historical tombstones should be reported. + /// The default value is true (enabled). + /// + public bool ReportHistoricalTombstones { get; set; } = true; + // ---------- Other ---------- internal List? InAppExcludes { get; private set; } diff --git a/src/Sentry/Platforms/Android/SentrySdk.cs b/src/Sentry/Platforms/Android/SentrySdk.cs index d47fe75664..c2b8454d94 100644 --- a/src/Sentry/Platforms/Android/SentrySdk.cs +++ b/src/Sentry/Platforms/Android/SentrySdk.cs @@ -156,6 +156,8 @@ private static void InitSentryAndroidSdk(SentryOptions options) o.ProfilesSampleRate = (JavaDouble?)options.Native.ProfilesSampleRate; o.PrintUncaughtStackTrace = options.Native.PrintUncaughtStackTrace; o.ReadTimeoutMillis = (int)options.Native.ReadTimeout.TotalMilliseconds; + o.TombstoneEnabled = options.Native.TombstoneEnabled; + o.ReportHistoricalAnrs = options.Native.ReportHistoricalTombstones; // In-App Excludes and Includes to be passed to the Android SDK options.Native.InAppExcludes?.ForEach(o.AddInAppExclude); From f99518028becd1df4d0197a951b019507db90fee Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 13 May 2026 11:58:27 +1200 Subject: [PATCH 2/3] fix(android): map historical tombstone option correctly Use ReportHistoricalTombstones instead of ReportHistoricalAnrs when applying NativeOptions.ReportHistoricalTombstones. Co-Authored-By: Justice --- src/Sentry/Platforms/Android/SentrySdk.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry/Platforms/Android/SentrySdk.cs b/src/Sentry/Platforms/Android/SentrySdk.cs index c2b8454d94..16f21d61b1 100644 --- a/src/Sentry/Platforms/Android/SentrySdk.cs +++ b/src/Sentry/Platforms/Android/SentrySdk.cs @@ -157,7 +157,7 @@ private static void InitSentryAndroidSdk(SentryOptions options) o.PrintUncaughtStackTrace = options.Native.PrintUncaughtStackTrace; o.ReadTimeoutMillis = (int)options.Native.ReadTimeout.TotalMilliseconds; o.TombstoneEnabled = options.Native.TombstoneEnabled; - o.ReportHistoricalAnrs = options.Native.ReportHistoricalTombstones; + o.ReportHistoricalTombstones = options.Native.ReportHistoricalTombstones; // In-App Excludes and Includes to be passed to the Android SDK options.Native.InAppExcludes?.ForEach(o.AddInAppExclude); From e7a2b7f6f71b100e466b8b4a2bba5f13d106abad Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 13 May 2026 13:48:29 +1200 Subject: [PATCH 3/3] fix(android): align tombstone defaults with Java SDK Set Native.TombstoneEnabled and Native.ReportHistoricalTombstones defaults to false, and update XML docs to match Java SDK behavior. Co-Authored-By: Justice --- src/Sentry/Platforms/Android/NativeOptions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Sentry/Platforms/Android/NativeOptions.cs b/src/Sentry/Platforms/Android/NativeOptions.cs index 78fbf72d66..5aa7f94bf5 100644 --- a/src/Sentry/Platforms/Android/NativeOptions.cs +++ b/src/Sentry/Platforms/Android/NativeOptions.cs @@ -209,15 +209,15 @@ internal NativeOptions(SentryOptions options) /// /// Gets or sets a value that indicates if native crash reporting via tombstones is enabled. - /// The default value is true (enabled). + /// The default value is false (disabled). /// - public bool TombstoneEnabled { get; set; } = true; + public bool TombstoneEnabled { get; set; } = false; /// /// Gets or sets a value that indicates if historical tombstones should be reported. - /// The default value is true (enabled). + /// The default value is false (disabled). /// - public bool ReportHistoricalTombstones { get; set; } = true; + public bool ReportHistoricalTombstones { get; set; } = false; // ---------- Other ----------