mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
## Problem Zero-copy layer transitions could leave the compositor in an inconsistent state when allocating an `ASurfaceTransaction` completion callback failed. Some failure paths released the current or previous `ASurfaceControl` even though the transaction had not been applied. This could invalidate layer state or release resources before the transition completed. ## Fix - Cancel and delete transactions when completion callback allocation fails. - Preserve the current layer and buffer state instead of releasing resources prematurely. - Roll back surface swaps when presentation cannot proceed. - Return an error from failed presentation paths and leave the layer available for recovery. - Apply the same failure handling to presentation, layer hiding and surface retirement. ## Tests - `git diff --check`: passed. - Native build: not run locally. - Device testing: > Tested on one device and helped with his problem, test build is up for further testing.