Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

Camera never focuses when scanning QR codes on devices with multiple back cameras (e.g., HMD Skyline on Android 15). The zxing library's default autofocus mode doesn't work reliably on these devices.

Changes

  • Configure CameraSettings.FocusMode.CONTINUOUS for barcode scanner camera in both QR scanning entry points:
    • QrScanFragment.java (used by QrActivity)
    • RegistrationQrActivity.java (used for second device setup)
CameraSettings settings = barcodeScannerView.getBarcodeView().getCameraSettings();
settings.setFocusMode(CameraSettings.FocusMode.CONTINUOUS);
barcodeScannerView.getBarcodeView().setCameraSettings(settings);

Continuous autofocus keeps adjusting focus as the scene changes, which is more reliable than single-shot autofocus on multi-camera systems.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx4608m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Blurr image while scanning QR</issue_title>
<issue_description>

  • Android version:15
  • Device: HMD Skyline
  • ArcaneChat version:2.11.0
  • Expected behavior: the camera image is focused
  • Actual behavior: the camera image never comes into focus
  • Steps to reproduce the problem: try to add a second device
  • Screenshots:
Image

</issue_description>

Comments on the Issue (you are @copilot in this section)

@adbenitez that sounds like a problem of your camera 🤔 @adbenitez the back camera is used, and if you meant there are 3 in the back that is up to the system, maybe try cleaning them 😅 @adbenitez could you try with this QR scanning app: https://f-droid.org/en/packages/com.example.barcodescanner/

thanks in advance</comment_new>
<comment_new>@adbenitez
ok so probably it is a problem with the QR library we use, sadly IIRC we can't upgrade it without having to drop support for android 5</comment_new>
<comment_new>@adbenitez
more than for your particular device 😁 sorry

but eventually it will get dropped when there are less remain android 5 users</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix blurr image issue when scanning QR codes Fix blurry camera during QR scanning on multi-camera devices Dec 5, 2025
Copilot AI requested a review from adbenitez December 5, 2025 01:12
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

To test the changes in this pull request, install this apk:
📦 app-preview.apk

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.

Blurr image while scanning QR

2 participants