RUM-16551: Fix hidden API reflection noise in Session Replay drawable mappers#3539
Conversation
47cba2c to
fcaadab
Compare
fcaadab to
2e1e50d
Compare
There was a problem hiding this comment.
Pull request overview
This PR reduces hidden-API reflection warnings/noise in the Session Replay drawable-to-color mappers by avoiding reflective access to PorterDuffColorFilter.mColor on Android P (API 28) and above, where that field is blocked, and removes now-dead reflection code in the compound button mapper.
Changes:
- Gate reflection of
PorterDuffColorFilter.mColortoSDK_INT < 28to prevent blocked hidden-API access on P+. - Remove an unused reflected
mButtonDrawablefield cache fromCheckableCompoundButtonMapper. - Minor KDoc typo fix (“layers”).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/mapper/AndroidMDrawableToColorMapper.kt | Avoids hidden-API reflection on P+ by only attempting mColor reflection on API < 28. |
| features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/mapper/CheckableCompoundButtonMapper.kt | Removes unused reflection field initialization for CompoundButton.mButtonDrawable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e1e50d029
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3539 +/- ##
========================================
Coverage 72.21% 72.22%
========================================
Files 966 966
Lines 35654 35650 -4
Branches 5951 5956 +5
========================================
- Hits 25747 25745 -2
- Misses 8275 8278 +3
+ Partials 1632 1627 -5
🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
1f7b2cf to
c225fe1
Compare
c225fe1 to
8b01e5c
Compare
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
8b01e5c to
95305a8
Compare
hamorillo
left a comment
There was a problem hiding this comment.
Thanks for the changes. 🚀
What does this PR do?
PorterDuffColorFilter.mColorreflection toAPI < 28, where the field is actually accessible. ON API 28+ the field is classified asmax-target-o, meaning it's blocked and was causing some noise in the logcat.mButtonDrawableFieldinCheckableCompoundButtonMapperthat was also causing noise.Review checklist (to be filled by reviewers)