Description
sentry-java 8.48.0 added two SentryAndroidOptions settings that expose sentry-native's heartbeat-based app-hang detection on Android:
setEnableNdkAppHangTracking(boolean) — default false
setNdkAppHangTimeoutIntervalMillis(long) — default 5000
sentry-react-native does not currently surface either option. On Android, app-hang tracking is treated as iOS-only: pauseAppHangTracking/resumeAppHangTracking are explicit no-ops (packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java), and the existing enableAppHangTracking / appHangTimeoutInterval options are documented @platform ios (packages/core/src/js/options.ts).
The SDK already bundles sentry-android 8.50.1 (packages/core/android/build.gradle), so the upstream APIs are available.
Suggested change
Add enableNdkAppHangTracking and ndkAppHangTimeoutIntervalMillis options, wired through the Android bridge to SentryAndroidOptions, so they can be configured from JS/TS. This mirrors the Capacitor request in getsentry/sentry-capacitor#1351 (which in turn mirrors iOS via getsentry/sentry-capacitor#1350).
Reference
Description
sentry-java
8.48.0added twoSentryAndroidOptionssettings that expose sentry-native's heartbeat-based app-hang detection on Android:setEnableNdkAppHangTracking(boolean)— defaultfalsesetNdkAppHangTimeoutIntervalMillis(long)— default5000sentry-react-native does not currently surface either option. On Android, app-hang tracking is treated as iOS-only:
pauseAppHangTracking/resumeAppHangTrackingare explicit no-ops (packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java), and the existingenableAppHangTracking/appHangTimeoutIntervaloptions are documented@platform ios(packages/core/src/js/options.ts).The SDK already bundles
sentry-android8.50.1(packages/core/android/build.gradle), so the upstream APIs are available.Suggested change
Add
enableNdkAppHangTrackingandndkAppHangTimeoutIntervalMillisoptions, wired through the Android bridge toSentryAndroidOptions, so they can be configured from JS/TS. This mirrors the Capacitor request in getsentry/sentry-capacitor#1351 (which in turn mirrors iOS via getsentry/sentry-capacitor#1350).Reference