captureScreenshot

suspend fun captureScreenshot(): ScreenshotResult

Captures the foreground Activity's window and stores it as an attachment, then mirrors it onto the timeline. Safe to call from any dispatcher -- the capture path hops to the main thread only where the underlying platform APIs require it.

Returns ScreenshotResult.Disabled without capturing anything when io.devconsole.api.DevConsoleConfig.screenshotPolicy is off, which is the default -- a screenshot cannot be redacted, so a host must opt in explicitly. On a protected build variant this is a no-op that always returns ScreenshotResult.DisabledForBuild.