Skip to content

ref(android): [minSdk 26 2] Remove code made obsolete by minSdk 26 - #6438

Draft
runningcode wants to merge 3 commits into
no/min-sdk-26-bumpfrom
no/min-sdk-26-remove-checks
Draft

runningcode wants to merge 3 commits into
no/min-sdk-26-bumpfrom
no/min-sdk-26-remove-checks

Conversation

@runningcode

@runningcode runningcode commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (minSdk 26)


📜 Description

Removes the code that minSdk 26 (#6435) made dead, and turns the ObsoleteSdkInt lint check back on.

  • @TargetApi / @RequiresApi annotations for API 26 and lower in sentry-android-core and sentry-android-replay
  • Runtime checks for API levels below 26, with the pre-26 branches they guarded:
    • profilers: the API 21 guard in AndroidTransactionProfiler and AndroidContinuousProfiler
    • network: the pre-M / pre-N paths in AndroidConnectionStatusProvider, NetworkBreadcrumbsIntegration and CellularNetworkTechnologyProvider, including the deprecated NetworkInfo fallback
    • ScreenshotUtils: the canvas fallback for pre-O devices. Screenshots always use PixelCopy now. The public signatures stay as they are because hybrid SDKs call them.
    • SentryFrameMetricsCollector: the API 24 availability check, and the Choreographer frame start fallback for pre-O devices
    • FirstDrawDoneListener: the pre-26 workaround for the floating ViewTreeObserver. Its BuildInfoProvider parameter is unused now, so it's removed.
    • AppStartMetrics: the pre-M fallback for MessageQueue.addIdleHandler
    • ReplayIntegration: the "API 26 and above" registration check
  • SentryRootCaSslSocketFactory and SentryRootCertificates (fix(android): Trust bundled ISRG Root X1 on API 25 and lower #6227). They only trusted the bundled ISRG Root X1 on API 25 and lower.
  • Unit tests that only covered those branches

@SuppressLint("NewApi") suppressions stay. Lint does not flag them, and many cover APIs above 26.

💡 Motivation and Context

Follow-up to #6435. This touches files that change often on main, so it should land close to the v9 release to keep merges from main into 9.x.x simple.

  • resolves: JAVA-547

💚 How did you test it?

  • lint for sentry-android-core, sentry-android-replay and sentry-android-ndk with ObsoleteSdkInt back on
  • Unit tests for sentry-android-core and sentry-android-replay

📝 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

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into 9.x.x.

#skip-changelog

runningcode and others added 2 commits October 30, 2026 13:09
Remove the API 26 and lower annotations, the runtime checks for API
levels below 26 and the branches they guarded, and the bundled ISRG
root CA socket factory that only applied to API 25 and lower. Turn the
ObsoleteSdkInt lint check back on.

Public methods that hybrid SDKs call keep their BuildInfoProvider
parameters.

Refs JAVA-547
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown

JAVA-547

@sentry

sentry Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

No deployments
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.

1 participant