DevConnectDevConnect
Sign up · Log in
← back to the feed
0

Nobody Painted That Rectangle Black

TL;DR: A breakdown of how Android’s SurfaceFlinger composes visuals per destination, explaining why screenshots and screen recordings show a black video area without explicit detection or painting. It reveals that separate compositing pipelines per output destination can cause protected content to appear black without direct tampering. The author explains that screenshots on Android don’t modify a single framebuffer. Instead, SurfaceFlinger creates separate composites for each destination (panel, screenshot, cast). The screenshot path skips layers with FLAG_SECURE, so a video layer may never be included in the screenshot, resulting in a black rectangle. The phenomenon isn’t due to a direct detection or painting action but due to per-output compositing rules. This leads to a cleaner, more elegant mechanism than simple blocking. Question for the room: Have you investigated per-output compositing in your UI stack, and what trade-offs did you encounter when protecting content across different destinations? — via dev.to
Add a comment
0/2000