fix(android): Handle default-package ANR frame modules (JAVA-696) - #5979
Open
0xadam-brown wants to merge 1 commit into
Open
fix(android): Handle default-package ANR frame modules (JAVA-696)#59790xadam-brown wants to merge 1 commit into
0xadam-brown wants to merge 1 commit into
Conversation
Updates `ThreadDumpParser` so ANR frames for classes in Java's default package are emitted with the correct module name. Prior to this commit, when the parser saw a Java or JNI frame whose class has no package, it would reconstruct the frame's module as though a package existed. That turned a class like `MainActivity` into `null.MainActivity`. This commit fixes that by teaching `ThreadDumpParser` to build the module name conditionally: - if a package name is present, emit `package.class` - if no package name is present, emit just `class` The same logic is applied consistently to both Java frames and JNI frames, since both parsing paths share the same optional-package shape.
0xadam-brown
force-pushed
the
fix/thread-dump-parser
branch
from
August 21, 2026 10:11
8df04d2 to
a8ad851
Compare
0xadam-brown
marked this pull request as ready for review
August 21, 2026 10:13
0xadam-brown
requested review from
adinauer,
markushi,
romtsn and
runningcode
as code owners
August 21, 2026 10:13
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| fc5ccaf | 322.49 ms | 405.25 ms | 82.76 ms |
| fcec2f2 | 328.91 ms | 387.75 ms | 58.84 ms |
| f064536 | 327.04 ms | 405.35 ms | 78.31 ms |
| 0eaac1e | 320.04 ms | 369.52 ms | 49.48 ms |
| 1edbdfa | 364.77 ms | 450.29 ms | 85.52 ms |
| 057ba36 | 305.64 ms | 379.43 ms | 73.79 ms |
| ad8da22 | 362.98 ms | 453.94 ms | 90.96 ms |
| d15471f | 369.38 ms | 459.08 ms | 89.70 ms |
| 926b414 | 319.88 ms | 362.02 ms | 42.14 ms |
| d15471f | 302.62 ms | 353.84 ms | 51.22 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| fc5ccaf | 1.58 MiB | 2.13 MiB | 557.54 KiB |
| fcec2f2 | 1.58 MiB | 2.12 MiB | 551.50 KiB |
| f064536 | 1.58 MiB | 2.20 MiB | 633.90 KiB |
| 0eaac1e | 1.58 MiB | 2.19 MiB | 619.17 KiB |
| 1edbdfa | 1.58 MiB | 2.20 MiB | 635.34 KiB |
| 057ba36 | 0 B | 0 B | 0 B |
| ad8da22 | 1.58 MiB | 2.29 MiB | 719.83 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 926b414 | 0 B | 0 B | 0 B |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
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.
📜 Description
Updates
ThreadDumpParserso ANR frames for classes in Java's default package are emitted with the correct module name.Prior to this PR, when the parser saw a Java or JNI frame whose class has no package, it would reconstruct the frame's module as though a package existed. That turned a class like
MainActivityintonull.MainActivity.This PR fixes that by teaching
ThreadDumpParserto build the module name conditionally:package.classclassThe same logic is applied consistently to both Java frames and JNI frames, since both parsing paths share the same optional-package shape.
💡 Motivation and Context
Absent this PR, we'd see:
resolves: JAVA-696
💚 How did you test it?
TDD-style unit tests.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps