Skip to content

fix(android): Only unbind this CameraSession's use cases instead of unbindAll() - #4229

Open
OlimpiaZurek wants to merge 1 commit into
margelo:mainfrom
OlimpiaZurek:fix/unbind-own-session
Open

OlimpiaZurek wants to merge 1 commit into
margelo:mainfrom
OlimpiaZurek:fix/unbind-own-session

Conversation

@OlimpiaZurek

Copy link
Copy Markdown

This PR makes an Android CameraSession unbind only the use cases it bound, instead of calling cameraProvider.unbindAll(). Opening one camera no longer turns off another camera that is still mounted.

Problem

HybridCameraSession calls cameraProvider.unbindAll() in configure() and dispose(). ProcessCameraProvider is shared across the app, so the call also unbinds every other mounted <Camera>.

We hit this when a camera screen stays mounted with isActive={false} while another camera screen is pushed on top:

  1. Screen A shows a <Camera> and navigates to screen B, which has its own <Camera>. A stays mounted and goes inactive.
  2. B's session calls unbindAll() when it configures and again when it disposes. Both calls unbind A's use cases.
  3. Back on A, isActive becomes true, but start() only activates the lifecycle. A's props haven't changed, so configure() doesn't run, nothing is bound, and the preview stays black until A remounts.

@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@OlimpiaZurek is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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