Skip to content

Restore camera executor after Android view reattachment - #817

Open
zack-dev-cm wants to merge 1 commit into
teslamotors:masterfrom
zack-dev-cm:fix/camera-executor-reattachment
Open

zack-dev-cm wants to merge 1 commit into
teslamotors:masterfrom
zack-dev-cm:fix/camera-executor-reattachment

Conversation

@zack-dev-cm

@zack-dev-cm zack-dev-cm commented Sep 15, 2026 •

Copy link
Copy Markdown

Summary

Detaching a CKCamera shuts down its camera executor. Reattaching the same view reuses that executor, so submitting analysis work throws RejectedExecutionException.

Create a new single-thread executor during attachment only when the previous executor is shut down. Detachment still lets already-submitted work finish on the old executor while the new attachment accepts work independently.

This addresses the separate reattachment defect noted in #813 and starts independently from upstream. Scanner ownership remains in #813, coordinate mapping in #812, and the iOS CI toolchain correction in #816.

How did you test this change?

Validation against unchanged a2a81ce:

  • The actual compiled CKCamera fails two Robolectric regressions with RejectedExecutionException; the active-executor control passes.
  • All three tests pass with the correction in both React Native architectures, without skips. They cover three reuse cycles, retaining an active executor, and reattachment while an old task is still finishing.
  • The Android Debug AAR builds with the new architecture enabled; git diff --check passes.

The tests invoke real view callbacks and executor threads. Camera permission is denied to isolate this lifecycle behavior, so physical-camera recovery is not claimed. iOS source is unchanged. These are contributor-reported results; upstream workflows, including the iOS build, await approval.

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