SIGN IN SIGN UP

perf(android): Replace RNSentryFrameDelayCollector with sentry-java getFramesDelay API (#6074)

* perf(android): Replace RNSentryFrameDelayCollector with sentry-java getFramesDelay API

Uses the new queryable `SentryFrameMetricsCollector.getFramesDelay()` API
from sentry-java (getsentry/sentry-java#5248, commit 61659b6) instead of
maintaining a custom listener-based collector.

Closes #5908

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add chanfgelog

* Update CHANGELOG for sentry-java API usage

Updated the changelog to reflect the use of sentry-java's getFramesDelay API and removed duplicate entry.

* style(android): Fix java formatting for RNSentryModuleImpl

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(android): Add unit tests for fetchNativeFramesDelay

Tests cover: null collector, valid delay result, negative delay result,
future timestamps, and zero delay with no slow frames.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(android): Add defensive null check on getFramesDelay result

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(android): Only set frameMetricsCollector when startCollection succeeds

Prevents getFramesDelay() from being called without an active listener
when startCollection() returns null.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
A
Antonis Lilis committed
5fda63b7dc0f9deaddde7652207b3433c9223854
Parent: bc0d8cf
Committed by GitHub <noreply@github.com> on 5/7/2026, 9:41:31 AM