Skip to content

Fix native window initialization crash for Android trimmed captures - #17

Merged
olehkuznetsov merged 1 commit into
android-graphics:devfrom
olehkuznetsov:tesh-google-head
Jul 23, 2026
Merged

Fix native window initialization crash for Android trimmed captures#17
olehkuznetsov merged 1 commit into
android-graphics:devfrom
olehkuznetsov:tesh-google-head

Conversation

@olehkuznetsov

Copy link
Copy Markdown

During playback of trimmed captures on Android, Application::Run would synchronously process the capture's state setup block without giving the Android looper a chance to pump events. Because the APP_CMD_INIT_WINDOW callback was never flushed, AndroidContext::GetWindow() would return a null pointer. When the state setup block contains vkCreateAndroidSurfaceKHR, replay would crash with a fatal error: "Failed to create ANDROID window for use with surface creation. Replay cannot continue."

This change actively blocks and pumps the ALooper events inside Application::Run before executing ProcessStateSetup, ensuring the native window is fully bound and avoiding the crash.

TAG=agy
CONV=ad6b54ea-58c1-4c68-9263-5df32aca3b92

During playback of trimmed captures on Android, `Application::Run` would synchronously process the capture's state setup block without giving the Android looper a chance to pump events. Because the `APP_CMD_INIT_WINDOW` callback was never flushed, `AndroidContext::GetWindow()` would return a null pointer. When the state setup block contains `vkCreateAndroidSurfaceKHR`, replay would crash with a fatal error: "Failed to create ANDROID window for use with surface creation. Replay cannot continue."

This change actively blocks and pumps the `ALooper` events inside `Application::Run` before executing `ProcessStateSetup`, ensuring the native window is fully bound and avoiding the crash.

TAG=agy
CONV=ad6b54ea-58c1-4c68-9263-5df32aca3b92
@olehkuznetsov
olehkuznetsov merged commit c1eb687 into android-graphics:dev Jul 23, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant