Skip to content

ref(android)!: Mark sentry-android-core classes final - #6494

Merged
runningcode merged 3 commits into
mainfrom
no/android-core-nopen
Nov 10, 2026
Merged

runningcode merged 3 commits into
mainfrom
no/android-core-nopen

Conversation

@runningcode

@runningcode runningcode commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

We weren't running no-open on sentry-android-core. In order to re-enable it we need to declare classes final. Technically this is a breaking API change so feel free to push back and say this should go on v9.
My goal is to re-enable no-open and error-prone.

The public classes outside internal packages that can no longer be subclassed are:

  • AnrV2Integration
  • AnrProfilingIntegration
  • The deprecated SentryUserFeedbackButton and SentryUserFeedbackDialog.Builder
  • WindowContentChangedCallback

The other classes are @ApiStatus.Internal or in an internal package.

SentryUserFeedbackForm and its Builder stay open, marked @Open, because the deprecated SentryUserFeedbackDialog and its Builder extend them until the dialog is removed.

💡 Motivation and Context

💚 How did you test it?

Compiled with Error Prone enabled: no Nopen findings remain and none are added. The sentry-android-core unit tests pass.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the 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.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Some of the internal classes are used by hybrid SDKs, for example AppStartMetrics, ScreenshotUtils and CurrentActivityHolder. Calling them is unaffected. Subclassing them, or mocking them with a subclass-based mock maker, no longer works.

Issues

🤖 Generated with Claude Code

@sentry

sentry Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.63.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode runningcode added the sanity-check PR needs a lightweight review for obvious issues label Nov 10, 2026
@runningcode
runningcode marked this pull request as ready for review November 10, 2026 07:15
@runningcode
runningcode requested review from a team and adinauer as code owners November 10, 2026 07:15
@runningcode
runningcode requested review from markushi and romtsn and removed request for a team November 10, 2026 07:15
@linear-code

linear-code Bot commented Nov 10, 2026

Copy link
Copy Markdown

JAVA-831

@romtsn romtsn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified with clanker that none of these classes are being inherited across public github repos and our hybrid SDKs 🎉

runningcode and others added 3 commits November 10, 2026 14:12
Error Prone's Nopen check requires every class to be final, abstract or @OPEN. It never ran on
sentry-android-core, so 42 classes were left open. None of them is subclassed except
ActivityLifecycleCallbacksAdapter, which becomes abstract since it is only extended, never
instantiated.

The protected members of the classes that are now final become package-private, as nothing can
subclass them anymore.

BREAKING CHANGE: AnrV2Integration, AnrProfilingIntegration, SentryUserFeedbackForm and its
Builder, WindowContentChangedCallback and several internal classes can no longer be subclassed.
ActivityLifecycleCallbacksAdapter can no longer be instantiated directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…APIs

On main, the deprecated SentryUserFeedbackDialog and its Builder still
extend SentryUserFeedbackForm and its Builder, so those two stay @OPEN
until the dialog is removed. The deprecated SentryUserFeedbackButton and
SentryUserFeedbackDialog.Builder become final.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode changed the base branch from 9.x.x to main November 10, 2026 13:16
@runningcode
runningcode force-pushed the no/android-core-nopen branch from dd61e10 to 53dde72 Compare November 10, 2026 13:16
@runningcode
runningcode enabled auto-merge (squash) November 10, 2026 13:22
@runningcode
runningcode merged commit bcc4ebe into main Nov 10, 2026
47 checks passed
@runningcode
runningcode deleted the no/android-core-nopen branch November 10, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants