Repository navigation
feat(replay): Add pauseTouchTracking and resumeTouchTracking - #6546
Merged
Merged
Conversation
This was referenced Nov 10, 2026
romtsn
marked this pull request as ready for review
November 11, 2026 14:34
romtsn
requested review from
0xadam-brown and
runningcode
and removed request for
a team
November 11, 2026 14:34
Apps can stop recording touches on sensitive screens, such as a custom PIN pad, while the masked screen recording continues. Masking hides the content, but recorded touch positions could reveal the input. The flag is independent of pause()/resume() and is cleared only by resumeTouchTracking(), also across new replays. It is set directly instead of being queued on the main thread, so it applies to touch events that are already pending. Also mark debugMaskingEnabled as volatile, it is written and read on different threads. Fixes JAVA-658 Fixes #5787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
romtsn
force-pushed
the
feat/replay-pause-touch-tracking
branch
from
November 13, 2026 08:26
8896004 to
811035c
Compare
Contributor
|
📲 Install BuildsAndroid
|
This was referenced Nov 13, 2026
Draft
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
Adds
Sentry.replay().pauseTouchTracking()andSentry.replay().resumeTouchTracking(). While touch tracking is paused,ReplayIntegrationdrops touch events, but the masked screen recording continues. This works in both session and buffer mode, so a buffered replay that is sent later also has no touches for that period.Behavior worth reviewing:
pause()/resume().resume()does not resume touch tracking, andresumeTouchTracking()does not record touches while the replay is paused.resumeTouchTracking()clears the flag.start(),stop()and new app sessions keep it, so touches cannot leak by accident. This is different frompause(), which an explicitstart()resets.@Volatile) instead of throughenqueueOnMainThreadlike the lifecycle commands. It does not touchReplayState, so its order relative to lifecycle commands does not matter, and a queued set could let touch events that are already pending on the main looper through.beforeBreadcrumbalready covers them.Also marks
debugMaskingEnabledas@Volatile, because it is written on the caller's thread and read on the recorder thread.💡 Motivation and Context
Masking hides sensitive content such as a custom PIN pad or a masked
WebView, but the recorded touch positions can still reveal the input.pause()already stops touches, but it also stops the screen recording, which some apps want to keep.The same API comes to sentry-cocoa in a parallel PR. Hybrid SDKs follow later.
💚 How did you test it?
Unit tests in
ReplayIntegrationTest: touches are dropped while screenshots continue,resume()does not resume touch tracking,resumeTouchTracking()waits forresume(), and the flag carries over to new replays, also when it is set before any replay starts.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
🤖 Generated with Claude Code