Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix "Unknown AF/AE/AWB State" error #2592

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

mrousavy
Copy link
Owner

What

In Camera2, there's CaptureResult.CONTROL_AF_STATE (or the respective value for AE and AWB).
These are the supported values: https://developer.android.com/reference/android/hardware/camera2/CaptureResult#CONTROL_AF_STATE

  • INACTIVE
  • PASSIVE_SCAN
  • PASSIVE_FOCUSED
  • ACTIVE_SCAN
  • FOCUSED_LOCKED
  • NOT_FOCUSED_LOCKED
  • PASSIVE_UNFOCUSED

For some reason, on a Samsung SM-S901B there is a situation where this value is 101 which is none of those enums. WTF?

So maybe Samsung has a proprietrary intermediate state which is not exposed to Android. In that case, we just use "UNKNOWN" instead to avoid this error being thrown.,

Changes

Tested on

Related issues

Copy link

vercel bot commented Feb 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview Feb 19, 2024 4:33pm

@mrousavy mrousavy merged commit fabf019 into main Feb 20, 2024
5 checks passed
@mrousavy mrousavy deleted the fix/fix-unknown-af-state branch February 20, 2024 07:54
isaaccolson pushed a commit to isaaccolson/deliveries-mobile that referenced this pull request Oct 30, 2024
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