Repository navigation
Conversation
`onInterruptionStarted` always reported `'unknown'` on Android because `HybridCameraSession` hardcoded `InterruptionReason.UNKNOWN` and the `StateError` that triggered the interruption was dropped. Pass it through, and map `ERROR_CAMERA_IN_USE` (another app or the system took the camera) to `'video-device-in-use-by-another-client'`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… interruption reasons CameraX reports three recoverable `CameraState` errors, which VisionCamera turns into interruptions. `ERROR_CAMERA_IN_USE` already maps to `'video-device-in-use-by-another-client'`; the other two had no matching `InterruptionReason`: - `ERROR_MAX_CAMERAS_IN_USE` -> `'max-cameras-in-use'` - `ERROR_OTHER_RECOVERABLE_ERROR` -> `'other-recoverable-error'` (device error or disconnect that CameraX retries) iOS never emits these values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@radko93 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Android,
onInterruptionStartedalways reports'unknown'.HybridCameraSession.onInterruptionStarted()hardcodesInterruptionReason.UNKNOWN, and the CameraXStateErrorthat caused the interruption is dropped inActiveCameraSessionSingle.We see devices (moto g stylus 5G 2024, motorola edge 2024) that get interrupted mid-recording in nearly every camera session, and without the reason we cannot tell why.
Change
fix(android): report the CameraX error behind an interruptionpasses theStateErrorthroughActiveCameraSession.Listenerand mapsERROR_CAMERA_IN_USEto the existing'video-device-in-use-by-another-client'. No public API change.feat(android): add max-cameras-in-use and other-recoverable-error interruption reasonscovers the other two RECOVERABLECameraStateerrors with two newInterruptionReasonvalues. iOS never emits them. Generated withbun camera specs.CameraX has exactly three RECOVERABLE errors, so with both commits the mapping is complete. The second commit is the API-visible part; happy to rename the values or drop it if you prefer a different mapping.
Verification
bun run lint-kotlin, biome,bun camera typecheckand the example apptscare clean../gradlew assembleDebugof the example app builds.'video-device-in-use-by-another-client'.Generated with Claude Code