Repository navigation
ref(android): Remove code made obsolete by minSdk 24 - #6519
Merged
Merged
Conversation
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>
3 of 9 tasks
📲 Install BuildsAndroid
|
runningcode
marked this pull request as ready for review
November 9, 2026 13:47
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 9, 2026 13:47
markushi
requested changes
Nov 9, 2026
markushi
left a comment
Member
There was a problem hiding this comment.
Maybe you can double check the usage of the "NewApi" lint ignores, other than that LGTM!
At minSdk 24, 35 of the 54 NewApi suppressions in sentry-android-core and sentry-android-replay no longer hide any lint error. The same goes for the two remaining ObsoleteSdkInt suppressions. The 19 that stay cover APIs above 24, behind BuildInfoProvider checks that lint can't see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
added a commit
that referenced
this pull request
Nov 10, 2026
* feat(android): Raise minSdk from 21 to 24 Raise the minimum supported Android API level of all Android modules from 21 to 24. The SDK_INT checks this makes obsolete stay for now, so lint's ObsoleteSdkInt check is disabled until they are removed. The R8 bundled with AGP 9.0 and 9.2 crashes on androidx.core at the new minSdk, so builds that override AGP run the R8 of the default AGP. Resolves #5508 Resolves JAVA-547 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * changelog * test(android): Drop obsolete API checks from the UI test app sentry-uitest-android lints with warningsAsErrors and is part of the root build, so its two pre-24 checks fail check at minSdk 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ref(android): Remove code made obsolete by minSdk 24 (#6519) * ref(android): Remove code made obsolete by minSdk 24 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> * ref(android): Remove NewApi suppressions lint no longer needs At minSdk 24, 35 of the 54 NewApi suppressions in sentry-android-core and sentry-android-replay no longer hide any lint error. The same goes for the two remaining ObsoleteSdkInt suppressions. The 19 that stay cover APIs above 24, behind BuildInfoProvider checks that lint can't see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(replay): Update detekt baseline for the removed NewApi suppression The baseline keys buildReplay by its signature, which included the @Suppress("NewApi") annotation removed in #6519. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ObsoleteSdkIntlint check back on.AndroidTransactionProfilerandAndroidContinuousProfilerAndroidConnectionStatusProvider,NetworkBreadcrumbsIntegrationandCellularNetworkTechnologyProvider, including the deprecatedNetworkInfotransport fallbackProcess.getStartUptimeMillis()inSentryAndroidandSentryPerformanceProvider, and the pre-M fallback forMessageQueue.addIdleHandlerinAppStartMetricsSentryFrameMetricsCollector: the API 24 availability check@RequiresApi/@TargetApiannotations for API 24 and lower insentry-android-coreandsentry-android-replayNewApilint suppressions, and the last twoObsoleteSdkIntones. Lint reports no error without them. The 19 that stay cover APIs above 24 behindBuildInfoProviderchecks, which lint can't see.💡 Motivation and Context
Follow-up to #6518.
💚 How did you test it?
CI
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
After #6518 is squash-merged, this branch needs
9.x.xmerged in before it can be merged.🤖 Generated with Claude Code
#skip-changelog