TakeScreenshotViaA11yTool

take_screenshot_via_a11y — capture the screen via AccessibilityService.takeScreenshot, awaiting the system callback. Unlike the screenshot module's MediaProjection path, this needs no consent prompt, but it requires API 30+ (the tool is filtered out of AccessibilityTools.supportedTools below that).

Params: format (png default lossless, or jpeg/jpg); quality (JPEG only, clamped 1–100, default 80; ignored for PNG).

On success returns format, width, height, and image_base64 (NO_WRAP base64 of the encoded image). Errors are long-form messages, one per failure mode: API-too-old, notConnectedError (service not bound), invalid format, and the framework ERROR_TAKE_SCREENSHOT_* codes — notably FLAG_SECURE windows (errorMessageFor) and the rate-limit (ERROR_TAKE_SCREENSHOT_INTERVAL_TIME_SHORT).

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
open override val annotations: ToolAnnotations
Link copied to clipboard
open override val description: String
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val parameters: List<ToolParameter>

Functions

Link copied to clipboard
open suspend override fun execute(params: Map<String, Any>): ToolResult