code-scanner icon indicating copy to clipboard operation
code-scanner copied to clipboard

Flash light not working in MIUI Android 10

Open vivekbdc opened this issue 3 years ago • 2 comments

I have implemented this lib working fine but only with MI device, it's not working and nothing error shows in logs.

vivekbdc avatar Feb 06 '21 07:02 vivekbdc

I found something in this. same device when try to turn on/off flash using lib it's not working. but when try to turn on/off flash using camera2 API it's working.

vivekbdc avatar Feb 07 '21 11:02 vivekbdc

Hi Guys, I'm also facing the issue which was mentioned by @vivekbdc .

Error : System.err: android.hardware.camera2.CameraAccessException: CAMERA_IN_USE (4): setTorchMode:2315: Torch for camera "0" is not available due to an existing camera user

Reproducing Method:

  1. After Implemented the code scanner codes. Scanner screen will open. We have to rise the camera's runtime permissions for scanning the qr code. I'm done this.
  2. QR codes are scanned well.
  3. Now I will try to open the flash light. Its not working and getting the following error. " System.err: android.hardware.camera2.CameraAccessException: CAMERA_IN_USE (4): setTorchMode:2315: Torch for camera "0" is not available due to an existing camera user"
  4. After this I have denied the camera permission. No we cannot scan the QR code the screen should be in black color. Now flash light working fine.

Try to Give a solution asap.

Thanks in advance!

ArunkumarChandraSekar avatar Jun 08 '21 04:06 ArunkumarChandraSekar