Skip to content

ref(android): Remove code made obsolete by minSdk 24 - #6519

Open
runningcode wants to merge 2 commits into
no/min-sdk-24from
no/min-sdk-24-remove-checks
Open

runningcode wants to merge 2 commits into
no/min-sdk-24from
no/min-sdk-24-remove-checks

Conversation

@runningcode

@runningcode runningcode commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (minSdk 24)


📜 Description

This is just my agent going through the codebase systematically to remove dead code.

Here's an AI summary of what this does:

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

  • Runtime checks for API levels below 24, with the branches they guarded:
    • profilers: the API 21 guard in AndroidTransactionProfiler and AndroidContinuousProfiler
    • network: the pre-M and pre-N paths in AndroidConnectionStatusProvider, NetworkBreadcrumbsIntegration and CellularNetworkTechnologyProvider, including the deprecated NetworkInfo transport fallback
    • app start: the API 24 check around Process.getStartUptimeMillis() in SentryAndroid and SentryPerformanceProvider, and the pre-M fallback for MessageQueue.addIdleHandler in AppStartMetrics
    • SentryFrameMetricsCollector: the API 24 availability check
  • @RequiresApi / @TargetApi annotations for API 24 and lower in sentry-android-core and sentry-android-replay

💡 Motivation and Context

Follow-up to #6518.

💚 How did you test it?

CI

📝 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

After #6518 is squash-merged, this branch needs 9.x.x merged in before it can be merged.

🤖 Generated with Claude Code

#skip-changelog

runningcode and others added 2 commits November 9, 2026 14:38
Remove the SDK_INT checks for API 24 and lower, with the branches they
guarded, and turn lint's ObsoleteSdkInt check back on. Most checks go
through BuildInfoProvider, which lint doesn't see, so it flagged only
five of them.

Code for API 25 and lower, such as the bundled root CAs, the pre-O
screenshot canvas and the Choreographer frame start, stays.

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

sentry Bot commented Nov 9, 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 marked this pull request as ready for review November 9, 2026 13:47
@runningcode
runningcode requested review from a team and adinauer as code owners November 9, 2026 13:47
@runningcode
runningcode requested review from 0xadam-brown and romtsn and removed request for a team November 9, 2026 13:47
@runningcode runningcode added next-major This should only be merged in the next major version. sanity-check PR needs a lightweight review for obvious issues labels Nov 9, 2026

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

next-major This should only be merged in the next major version. sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant