From bde7783885f6d1ae5a31f7344a40b61931ae7dfe Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 2 Jul 2026 16:48:54 +0200 Subject: [PATCH 1/2] tombstone options --- .../android/core/ManifestMetadataReader.java | 7 +++ .../core/ManifestMetadataReaderTest.kt | 50 +++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java b/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java index c34ee0dbfa..6ae9be3e8b 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java @@ -37,6 +37,7 @@ final class ManifestMetadataReader { static final String TOMBSTONE_ENABLE = "io.sentry.tombstone.enable"; static final String TOMBSTONE_ATTACH_RAW = "io.sentry.tombstone.attach-raw"; + static final String TOMBSTONE_REPORT_HISTORICAL = "io.sentry.tombstone.report-historical"; static final String AUTO_INIT = "io.sentry.auto-init"; static final String NDK_ENABLE = "io.sentry.ndk.enable"; @@ -232,6 +233,12 @@ static void applyMetadata( readBool(metadata, logger, TOMBSTONE_ENABLE, options.isTombstoneEnabled())); options.setAttachRawTombstone( readBool(metadata, logger, TOMBSTONE_ATTACH_RAW, options.isAttachRawTombstone())); + options.setReportHistoricalTombstones( + readBool( + metadata, + logger, + TOMBSTONE_REPORT_HISTORICAL, + options.isReportHistoricalTombstones())); // use enableAutoSessionTracking as fallback options.setEnableAutoSessionTracking( diff --git a/sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt b/sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt index 3b12e6489a..94da78fcfa 100644 --- a/sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt +++ b/sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt @@ -313,6 +313,56 @@ class ManifestMetadataReaderTest { assertEquals(false, fixture.options.isAttachRawTombstone) } + @Test + fun `applyMetadata reads tombstone enable to options`() { + // Arrange + val bundle = bundleOf(ManifestMetadataReader.TOMBSTONE_ENABLE to true) + val context = fixture.getContext(metaData = bundle) + + // Act + ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider) + + // Assert + assertEquals(true, fixture.options.isTombstoneEnabled) + } + + @Test + fun `applyMetadata reads tombstone enable to options and keeps default`() { + // Arrange + val context = fixture.getContext() + + // Act + ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider) + + // Assert + assertEquals(false, fixture.options.isTombstoneEnabled) + } + + @Test + fun `applyMetadata reads tombstone report historical to options`() { + // Arrange + val bundle = bundleOf(ManifestMetadataReader.TOMBSTONE_REPORT_HISTORICAL to true) + val context = fixture.getContext(metaData = bundle) + + // Act + ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider) + + // Assert + assertEquals(true, fixture.options.isReportHistoricalTombstones) + } + + @Test + fun `applyMetadata reads tombstone report historical to options and keeps default`() { + // Arrange + val context = fixture.getContext() + + // Act + ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider) + + // Assert + assertEquals(false, fixture.options.isReportHistoricalTombstones) + } + @Test fun `applyMetadata reads anr report historical to options`() { // Arrange From 1a76fb913e6ed615836831500322350513e029f9 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 2 Jul 2026 17:32:11 +0200 Subject: [PATCH 2/2] updated changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a290e2b3e..f8075eb9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Features + +- Support the `io.sentry.tombstone.report-historical` manifest option to enable historical tombstone reporting via `AndroidManifest.xml` `` ([#5683](https://github.com/getsentry/sentry-java/pull/5683)) + ## 8.47.0 ### Behavioral Changes