fix(android): Init with ApplicationContext if available#4780
Merged
krystofwoldrich merged 6 commits intomainfrom Apr 30, 2025
Merged
fix(android): Init with ApplicationContext if available#4780krystofwoldrich merged 6 commits intomainfrom
krystofwoldrich merged 6 commits intomainfrom
Conversation
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b7e707e | 422.32 ms | 412.10 ms | -10.22 ms |
| 3853f43 | 329.68 ms | 346.32 ms | 16.64 ms |
| d16beca | 448.87 ms | 447.20 ms | -1.67 ms |
| 77680ec | 482.22 ms | 475.07 ms | -7.16 ms |
| 31e279d | 444.07 ms | 443.65 ms | -0.41 ms |
| 8900e1a+dirty | 430.68 ms | 456.13 ms | 25.44 ms |
| 62a750b | 395.96 ms | 423.36 ms | 27.41 ms |
| 22bcd92 | 441.47 ms | 428.18 ms | -13.29 ms |
| d43a46b | 454.22 ms | 477.79 ms | 23.57 ms |
| a15d370 | 431.43 ms | 440.25 ms | 8.82 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b7e707e | 17.75 MiB | 20.13 MiB | 2.38 MiB |
| 3853f43 | 17.73 MiB | 19.81 MiB | 2.08 MiB |
| d16beca | 17.74 MiB | 20.10 MiB | 2.36 MiB |
| 77680ec | 17.74 MiB | 20.08 MiB | 2.34 MiB |
| 31e279d | 17.75 MiB | 20.13 MiB | 2.38 MiB |
| 8900e1a+dirty | 17.73 MiB | 19.75 MiB | 2.01 MiB |
| 62a750b | 17.73 MiB | 19.93 MiB | 2.20 MiB |
| 22bcd92 | 17.75 MiB | 20.12 MiB | 2.37 MiB |
| d43a46b | 17.73 MiB | 20.06 MiB | 2.33 MiB |
| a15d370 | 17.75 MiB | 20.13 MiB | 2.38 MiB |
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8e80789+dirty | 1228.04 ms | 1237.20 ms | 9.16 ms |
| eb1e19f+dirty | 1209.56 ms | 1214.94 ms | 5.38 ms |
| 950b04f+dirty | 1223.18 ms | 1222.48 ms | -0.71 ms |
| 73fc872+dirty | 1236.16 ms | 1237.15 ms | 0.99 ms |
| e2aa97e+dirty | 1227.40 ms | 1233.65 ms | 6.26 ms |
| 48ad514+dirty | 1235.90 ms | 1238.20 ms | 2.31 ms |
| a989877+dirty | 1228.56 ms | 1227.71 ms | -0.85 ms |
| 5e5c392+dirty | 1231.96 ms | 1228.74 ms | -3.21 ms |
| 8c88ac7+dirty | 1205.13 ms | 1218.87 ms | 13.74 ms |
| 9c48b2c+dirty | 1246.96 ms | 1255.73 ms | 8.77 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8e80789+dirty | 2.36 MiB | 3.10 MiB | 759.43 KiB |
| eb1e19f+dirty | 2.36 MiB | 3.08 MiB | 737.21 KiB |
| 950b04f+dirty | 2.63 MiB | 3.78 MiB | 1.14 MiB |
| 73fc872+dirty | 2.63 MiB | 3.76 MiB | 1.13 MiB |
| e2aa97e+dirty | 2.63 MiB | 3.75 MiB | 1.12 MiB |
| 48ad514+dirty | 2.63 MiB | 3.75 MiB | 1.12 MiB |
| a989877+dirty | 2.36 MiB | 3.10 MiB | 752.40 KiB |
| 5e5c392+dirty | 2.63 MiB | 3.75 MiB | 1.12 MiB |
| 8c88ac7+dirty | 2.36 MiB | 3.10 MiB | 752.63 KiB |
| 9c48b2c+dirty | 2.36 MiB | 2.85 MiB | 495.77 KiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 13f280b+dirty | 376.13 ms | 406.41 ms | 30.28 ms |
| 31e279d+dirty | 458.49 ms | 467.69 ms | 9.20 ms |
| 1c65324+dirty | 381.10 ms | 427.26 ms | 46.16 ms |
| eb1e19f+dirty | 391.37 ms | 418.27 ms | 26.90 ms |
| a15d370+dirty | 376.25 ms | 388.17 ms | 11.92 ms |
| ac41368+dirty | 395.91 ms | 451.17 ms | 55.26 ms |
| 255d28b+dirty | 389.76 ms | 382.73 ms | -7.03 ms |
| 87dd218+dirty | 449.30 ms | 459.66 ms | 10.36 ms |
| e2b64fe+dirty | 258.82 ms | 304.26 ms | 45.44 ms |
| e4ac943+dirty | 384.67 ms | 383.37 ms | -1.30 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 13f280b+dirty | 7.15 MiB | 8.35 MiB | 1.20 MiB |
| 31e279d+dirty | 7.15 MiB | 8.40 MiB | 1.25 MiB |
| 1c65324+dirty | 7.15 MiB | 8.22 MiB | 1.07 MiB |
| eb1e19f+dirty | 7.15 MiB | 8.35 MiB | 1.20 MiB |
| a15d370+dirty | 7.15 MiB | 8.40 MiB | 1.25 MiB |
| ac41368+dirty | 7.15 MiB | 8.39 MiB | 1.24 MiB |
| 255d28b+dirty | 7.15 MiB | 8.39 MiB | 1.23 MiB |
| 87dd218+dirty | 7.15 MiB | 8.39 MiB | 1.23 MiB |
| e2b64fe+dirty | 7.15 MiB | 8.07 MiB | 947.16 KiB |
| e4ac943+dirty | 7.15 MiB | 8.40 MiB | 1.25 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8e80789+dirty | 1235.66 ms | 1223.78 ms | -11.88 ms |
| eb1e19f+dirty | 1229.91 ms | 1231.63 ms | 1.71 ms |
| 950b04f+dirty | 1220.28 ms | 1218.07 ms | -2.21 ms |
| 73fc872+dirty | 1235.27 ms | 1228.18 ms | -7.08 ms |
| e2aa97e+dirty | 1220.17 ms | 1219.81 ms | -0.36 ms |
| 48ad514+dirty | 1230.53 ms | 1233.76 ms | 3.22 ms |
| a989877+dirty | 1222.90 ms | 1219.89 ms | -3.00 ms |
| 5e5c392+dirty | 1224.72 ms | 1229.52 ms | 4.80 ms |
| 8c88ac7+dirty | 1240.66 ms | 1247.42 ms | 6.76 ms |
| 9c48b2c+dirty | 1253.39 ms | 1256.30 ms | 2.91 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8e80789+dirty | 2.92 MiB | 3.67 MiB | 772.00 KiB |
| eb1e19f+dirty | 2.92 MiB | 3.64 MiB | 742.82 KiB |
| 950b04f+dirty | 3.19 MiB | 4.34 MiB | 1.16 MiB |
| 73fc872+dirty | 3.19 MiB | 4.33 MiB | 1.14 MiB |
| e2aa97e+dirty | 3.19 MiB | 4.32 MiB | 1.13 MiB |
| 48ad514+dirty | 3.19 MiB | 4.32 MiB | 1.13 MiB |
| a989877+dirty | 2.92 MiB | 3.66 MiB | 757.66 KiB |
| 5e5c392+dirty | 3.19 MiB | 4.32 MiB | 1.13 MiB |
| 8c88ac7+dirty | 2.92 MiB | 3.66 MiB | 757.12 KiB |
| 9c48b2c+dirty | 2.92 MiB | 3.41 MiB | 499.97 KiB |
added 2 commits
April 28, 2025 17:30
Collaborator
|
Does it make sense to add the blocking label if this PR depends on the mentioned Java PR? |
antonis
approved these changes
Apr 29, 2025
Contributor
antonis
left a comment
There was a problem hiding this comment.
The changes on this PR and the unit tests LGTM 🚀
Contributor
Author
|
The Android init expects to receive Application instance, regardless the deferred init, so I would go ahead merging this. |
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.
📢 Type of change
📜 Description
This PR passes
applicationContextto thesentry-androidinitialization function.This PR is need for improving the current activity tracking from getsentry/sentry-java#4337.
Passing applicationContext will cause the
CurrentActivityIntegrationto be added, which ensures that if activity changes, the global holder hast the correct reference.💚 How did you test it?
sample app, unit tests
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps