Skip to content

feat(android): Add enableUserInteractionBreadcrumbs option - #7016

Open
GersonRocha9 wants to merge 2 commits into
getsentry:mainfrom
GersonRocha9:feat/android-user-interaction-breadcrumbs
Open

GersonRocha9 wants to merge 2 commits into
getsentry:mainfrom
GersonRocha9:feat/android-user-interaction-breadcrumbs

Conversation

@GersonRocha9

Copy link
Copy Markdown

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds the Android-only enableUserInteractionBreadcrumbs option and forwards it to sentry-java, in the same way as the breadcrumb off-switches from #6764 and #6768.

  • RNSentryStart.java calls options.setEnableUserInteractionBreadcrumbs(...) only when the key is present, so the native default (true) does not change.
  • options.ts has the type with JSDoc (@default true, @platform android). The JSDoc says that the native breadcrumbs duplicate the JS touch breadcrumbs only when the app uses Sentry.wrap, which adds TouchEventBoundary.
  • The API report and the CHANGELOG have the new option.

Native user interaction tracing is false by default in sentry-java, and the React Native SDK does not turn it on. So when this option is false, UserInteractionIntegration.register does not install the window callback.

💡 Motivation and Context

Closes #6993

The native UserInteractionIntegration wraps the Window.Callback of each activity and does gesture detection on the main thread for every touch event. On low-end Android devices we saw ANRs with the blocked main-thread frame inside this callback. Before this change, the only way to turn the integration off from a React Native or Expo app was manifest meta-data.

💚 How did you test it?

  • RNSentryStartTest.enableUserInteractionBreadcrumbsForwarded checks true, false, and that the native default stays when the option is not set (./gradlew :RNSentry:testDebugUnitTest --tests 'io.sentry.react.RNSentryStartTest').
  • wrapper.test.ts checks that the option reaches the native init parameters.
  • yarn lint, yarn lint:android and yarn api-report:check pass locally.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

Add the option to the React Native options page in sentry-docs.

Forward the option to sentry-java so an app can turn off native user interaction breadcrumbs on Android. When the option is false and native user interaction tracing is off (the default), UserInteractionIntegration does not wrap the activity Window.Callback.

Closes getsentry#6993
@GersonRocha9
GersonRocha9 requested review from a team and lucas-zimerman as code owners November 10, 2026 20:40
@GersonRocha9
GersonRocha9 requested review from 0xadam-brown, alwx, antonis, itaybre, philprime and runningcode and removed request for a team November 10, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose enableUserInteractionBreadcrumbs (Android) to disable the native UserInteractionIntegration

1 participant