Many Android apps mark sensitive screens with FLAG_SECURE, which stops screenshots and screen recording. Payment forms, health records and login pages commonly use it. Session replay tools capture the screen, so the two features pull in opposite directions.
PostHog’s Android SDK 3.74.2 settled this in favour of privacy: windows with FLAG_SECURE are recorded as fully masked in screenshot mode, and as solid black in wireframe mode. Release 3.74.1 also masks the children of a ph-no-capture view even when they draw outside an unclipped container, and may skip snapshots while those children animate.
That is the right default, but it creates a measurement problem. Secure screens now show up as blanks in your replays. If you do not track them, you may think replay is broken, or worse, assume a screen is protected when it is not.
Data Points to Track
replay_secure_window(true / false) on each screen view, set when the window hasFLAG_SECUREreplay_mask_mode(screenshot / wireframe) andreplay_masked_area_pctper screenreplay_snapshot_skippedwith a reason such as animating_masked_viewscreen_nameandapp_versionon every replay eventreplay_sdk_version, to separate sessions recorded before and after the upgrade- Replay coverage rate: share of sessions with at least one usable (unmasked) replay segment
- Opt-in state: whether the session started after an
optIn()call
Setup Steps
- List your secure screens. Search the code for
FLAG_SECUREandsetSecure, including any added by libraries. - Upgrade the PostHog Android SDK to 3.74.2 or later.
- Send
replay_secure_windowas a property with each screen event, using the same flag your code sets. - Mark sensitive views with
ph-no-captureand check on a device that nested children are masked too. - Record a test session through each secure and no-capture screen in both masking modes, and review the replay by eye.
- Build a dashboard showing replay coverage by screen and app version.
Actionable Insights
Black or masked screens on your secure list are the expected result. Black screens elsewhere are a bug: either a stray FLAG_SECURE or a view that is masked by mistake. Compare your screen list with the masked-area percentage to find them.
Low coverage on key funnel steps is the cost. If a checkout step is secure, use event data such as taps, errors and time on screen instead of video, and add custom events to fill the gap.
Skipped snapshots during animation matter too. If one screen loses many, simplify its animation or move the sensitive element out of the moving container, and re-check coverage after the next release.
Lastly, review the opt-in path. Release 3.74.1 and the matching core fix also stop replay from recording into a session that was opted out when a feature flag or pending remote config delayed the restart after optIn(). If your consent flow calls optIn() and optOut() often, compare replay session counts with consent counts. A gap means you are either recording too little or, more seriously, recording users who declined.