Added in API level 30

AccessibilityService.ScreenshotResult


public static final class AccessibilityService.ScreenshotResult
extends Object

java.lang.Object
   ↳ android.accessibilityservice.AccessibilityService.ScreenshotResult


Can be used to construct a bitmap of the screenshot or any other operations for AccessibilityService#takeScreenshot API.

Summary

Public methods

ColorSpace getColorSpace()

Gets the ColorSpace identifying a specific organization of colors of the screenshot.

HardwareBuffer getHardwareBuffer()

Gets the HardwareBuffer representing a memory buffer of the screenshot.

long getTimestamp()

Gets the timestamp of taking the screenshot.

Inherited methods

Public methods

getColorSpace

Added in API level 30
public ColorSpace getColorSpace ()

Gets the ColorSpace identifying a specific organization of colors of the screenshot.

Returns
ColorSpace the color space This value cannot be null.

getHardwareBuffer

Added in API level 30
public HardwareBuffer getHardwareBuffer ()

Gets the HardwareBuffer representing a memory buffer of the screenshot.

Note: The application should call HardwareBuffer#close() when the buffer is no longer needed to free the underlying resources.

Returns
HardwareBuffer the hardware buffer This value cannot be null.

getTimestamp

Added in API level 30
public long getTimestamp ()

Gets the timestamp of taking the screenshot.

Returns
long milliseconds of non-sleep uptime before screenshot since boot and it's from SystemClock#uptimeMillis()