Skip to content

Conversation

@romtsn
Copy link
Member

@romtsn romtsn commented Aug 5, 2025

📜 Description

Updated ContextUtilsTest to correctly verify Context.registerReceiver calls for API 32-.

💡 Motivation and Context

The ContextUtilsTest for API 32- was incorrectly verifying a 4-parameter overload of context.registerReceiver. In Android, the 4-parameter registerReceiver method internally delegates to the 5-parameter overload, passing 0 as the default flags value. This fix updates the test to verify the 5-parameter overload with flags = 0, accurately reflecting the runtime behavior and aligning with how other tests verify registerReceiver calls.

💚 How did you test it?

The updated test itself verifies the fix by asserting the correct Context.registerReceiver overload and parameters are called.

📝 Checklist

  • 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.

🔮 Next steps


Open in Cursor Open in Web

Co-authored-by: roman.zavarnitsyn <roman.zavarnitsyn@sentry.io>
@cursor
Copy link

cursor bot commented Aug 5, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Fix contextutils test registerreceiver overload mismatch ([#4608](https://github.com/getsentry/sentry-java/pull/4608))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 182e760

@romtsn romtsn closed this Aug 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 439.13 ms 486.94 ms 47.81 ms
Size 1.58 MiB 2.09 MiB 521.49 KiB

Baseline results on branch: rz/perf/enhanced-executor-service

Startup times

Revision Plain With Sentry Diff
018e963 419.07 ms 463.71 ms 44.64 ms

App size

Revision Plain With Sentry Diff
018e963 1.58 MiB 2.09 MiB 521.49 KiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants