Skip to content

feat(android): update session replay masking precedence rules#518

Open
beekld wants to merge 2 commits intomainfrom
beeklimt/O11Y-1397
Open

feat(android): update session replay masking precedence rules#518
beekld wants to merge 2 commits intomainfrom
beeklimt/O11Y-1397

Conversation

@beekld
Copy link
Copy Markdown
Contributor

@beekld beekld commented May 1, 2026

Summary

Changes Android semantics to match iOS when applying session replay masking precedence rules.

This changes existing masking behavior, but should be clearer than the previous behavior. Please see the README changes for details.

How did you test this change?

Unit tests added.

Are there any deployment considerations?

N/A


Note

Medium Risk
Changes core session replay privacy behavior by redefining masking/unmasking precedence and propagation, which could alter what data is redacted in production replays if apps relied on the previous rules.

Overview
Aligns Android Session Replay masking behavior with a strict precedence model: explicit masks (including maskXMLViewIds) propagate to descendants and override everything, explicit unmask propagates but cannot override an explicit mask, and global privacy matchers (e.g. maskTextInputs, maskText, view-class/webview/keyword heuristics) apply only to the matched node.

Implements this by splitting PrivacyProfile matchers into explicitMaskMatchers vs globalMaskMatchers, updating MaskCollector.collectMasks traversal to carry inherited explicit state across native + Compose targets (including new hasLDUnmask), wiring the new matcher lists through ImageCaptureService, and adding unit tests plus README documentation to codify the new rules.

Reviewed by Cursor Bugbot for commit 4973194. Bugbot is set up for automated code reviews on this repo. Configure here.

@beekld beekld requested a review from a team as a code owner May 1, 2026 00:53
* signal applies.
*/
private fun resolveExplicit(target: MaskTarget, inherited: Boolean?, context: MaskContext): Boolean? {
val self = explicitOf(target, context)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using self name is hard to understand, maybe ownExplicit ?

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.

2 participants