-
-
Notifications
You must be signed in to change notification settings - Fork 465
ref(android): Update targetSdk to API 36 (Android 16) #5016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
markushi
wants to merge
3
commits into
main
Choose a base branch
from
ref/android-16-target-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Updates targetSdk and compileSdk to API Level 36 for Android 16 support. Breaking changes addressed: - Created ThreadUtil helper for version-aware thread ID retrieval - Migrated from deprecated Thread.getId() to Thread.threadId() with backward compatibility - Updated sample app to use OnBackPressedCallback instead of deprecated onBackPressed() The scheduleAtFixedRate behavior change is acceptable for our performance collection use case.
Member
Author
|
@sentry review |
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| abfcc92 | 337.38 ms | 427.39 ms | 90.00 ms |
| d5a29b6 | 298.62 ms | 391.78 ms | 93.16 ms |
| ee747ae | 396.82 ms | 441.67 ms | 44.86 ms |
| d15471f | 294.13 ms | 399.49 ms | 105.36 ms |
| 91bb874 | 314.47 ms | 440.00 ms | 125.53 ms |
| d15471f | 307.28 ms | 381.85 ms | 74.57 ms |
| 9fbb112 | 401.87 ms | 515.87 ms | 114.00 ms |
| ee747ae | 400.46 ms | 423.61 ms | 23.15 ms |
| abfcc92 | 304.04 ms | 370.33 ms | 66.29 ms |
| fc5ccaf | 256.80 ms | 322.36 ms | 65.56 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| d5a29b6 | 1.58 MiB | 2.12 MiB | 549.37 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 91bb874 | 1.58 MiB | 2.13 MiB | 559.07 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 9fbb112 | 1.58 MiB | 2.11 MiB | 539.18 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| fc5ccaf | 1.58 MiB | 2.13 MiB | 557.54 KiB |
Member
Author
|
Retriggered the failed CI checks. The failures appear to be pre-existing flaky tests:
These failures are not related to the Android 16 targetSdk update changes in this PR. |
markushi
commented
Jan 12, 2026
sentry-android-core/src/main/java/io/sentry/android/core/util/ThreadUtil.java
Outdated
Show resolved
Hide resolved
Move getThreadId helper method from ThreadUtil into AndroidThreadChecker to consolidate thread-related utilities. Simplify CHANGELOG entry. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Member
Author
|
Addressed PR feedback:
All changes have been pushed in commit 4a54919. |
8 tasks
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.
📜 Description
Updates targetSdk and compileSdk to API Level 36 to support Android 16.
This PR addresses breaking changes introduced in Android 16:
ThreadUtilhelper class for version-aware thread ID retrievalThread.getId()toThread.threadId()with backward compatibility for minSdk 21OnBackPressedCallbackinstead of deprecatedonBackPressed()which is no longer called in Android 16onLowMemory()(deprecated in Android 15)💡 Motivation and Context
Android 16 (API Level 36) deprecates several APIs that the SDK currently uses:
Thread.getId()is deprecated in favor ofThread.threadId()(available since API 34)onBackPressed()is no longer called for apps targeting Android 16The
scheduleAtFixedRatebehavior change (only executing ONE missed task instead of ALL) is acceptable and even beneficial for our performance collection use case.💚 How did you test it?
./gradlew spotlessApply apiDump📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
# Unreleasedsection