Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Features

- Android: The `ManifestMetaDataReader` now reads `ANR_REPORT_HISTORICAL` ([#5387](https://github.com/getsentry/sentry-java/pull/5387))
Comment thread
bitsandfoxes marked this conversation as resolved.
Outdated

## 8.41.0

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ final class ManifestMetadataReader {
static final String ANR_REPORT_DEBUG = "io.sentry.anr.report-debug";
static final String ANR_TIMEOUT_INTERVAL_MILLIS = "io.sentry.anr.timeout-interval-millis";
static final String ANR_ATTACH_THREAD_DUMPS = "io.sentry.anr.attach-thread-dumps";
static final String ANR_REPORT_HISTORICAL = "io.sentry.anr.report-historical";

static final String TOMBSTONE_ENABLE = "io.sentry.tombstone.enable";

Expand Down Expand Up @@ -254,6 +255,9 @@ static void applyMetadata(
options.setAttachAnrThreadDump(
readBool(metadata, logger, ANR_ATTACH_THREAD_DUMPS, options.isAttachAnrThreadDump()));

options.setReportHistoricalAnrs(
readBool(metadata, logger, ANR_REPORT_HISTORICAL, options.isReportHistoricalAnrs()));

final @Nullable String dsn = readString(metadata, logger, DSN, options.getDsn());
final boolean enabled = readBool(metadata, logger, ENABLE_SENTRY, options.isEnabled());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,31 @@ class ManifestMetadataReaderTest {
assertEquals(false, fixture.options.isAttachAnrThreadDump)
}

@Test
fun `applyMetadata reads anr report historical to options`() {
// Arrange
val bundle = bundleOf(ManifestMetadataReader.ANR_REPORT_HISTORICAL to true)
val context = fixture.getContext(metaData = bundle)

// Act
ManifestMetadataReader.applyMetadata(context, fixture.options, fixture.buildInfoProvider)

// Assert
assertEquals(true, fixture.options.isReportHistoricalAnrs)
}

@Test
fun `applyMetadata reads anr 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.isReportHistoricalAnrs)
}

@Test
fun `applyMetadata reads activity breadcrumbs to options`() {
// Arrange
Expand Down
Loading