Android 16 QPR2 introduced productionized display processing unit (DPU) readback. DPU readback was first introduced in Android 9 to test Hardware Composer (HWC) output, leveraging a hardware block to "read back" on-screen pixels into CPU-accessible memory. You can use DPU readback in production for use cases that require capturing full-screen content.
Use cases
Readback hardware is suitable for:
Animations that require transforming a static state of the entire screen, such as power-off animations
Artificial intelligence (AI) use cases that require knowledge of the screen content in a secure enclave
Automated testing
Readback hardware isn't suitable for:
Capturing a subset of screen state that excludes or hides other visible on-screen content
Capturing DRM-protected content and transmitting it to an insecure environment
Enable readback
To enable readback:
Use
IComposerClient::getReadbackBufferAttributesto specify that the HWC implementation reports readback buffer attributes.Enable the
debug.sf.productionize_readback_screenshotsystem property.This signals to the system that DPU readback is performant and free of visual bugs, and ready for production use.
Use the
ScreenCapturesystem API to request a DPU-backed screenshot. The system attempts to use DPU readback if possible, but API clients can require it by passing theCAPTURE_MODE_REQUIRE_OPTIMIZEDflag.
Testing readback
We recommend testing multiple user journeys, focusing on performance, correctness, and power draw. Test the use cases listed earlier to verify that performance is acceptable and there are no visual bugs, such as screen flickering or unintended color shift.