SecUSo/privacy-friendly-torchlight

Flashlight app can not reconnect to Camera

Closed this issue · 7 comments

Sometimes it happens that no app can reconnect to the camera. I think that happens if this app enables the LED, then another app is activated (via Home button for example), then this app is started again.
This is seen on S4 mini with its Android 4.4, and on S5 with its Android 5.0

Does it actually work reliable for the author?

If another camera app is started meanwhile so the following scenario:

  • Turn on Privacy Friendly Torchlight and leave it open.
  • Open other app that connects to the camera, e.g. the camera turn off the flashlight.
  • Going back to the app the flashlight button has to be pressed twice to turn on the flashlight again.

It is not specific about another Camera app, just switching to something else, then returning to this flashlight app causes a "Can not connect to Camera". It seems my S5 is more forgiving than the S4 mini. On the S4 no app was able to reconnect. But for some reason starting this app and opeing the "Über.." screen caused the LED to go off. Then all apps are able to use the LED again.

I will reinstall it on the S5 to see if adb can gather any logfiles.

Looks like the behaviour is not consistent. Sometimes the LED can be turned on and off, sometimes it just has 50% brightness. Will try to get a clean repro case.

W/QCamera2Factory( 290): getCameraInfo: E, camera_id = 0 W/QCamera2HWI( 290): __dbg: info->orientation : 90 rc = 0 W/QCamera2Factory( 290): getCameraInfo: X I/EDMNativeHelperService( 936): isCameraEnabled W/CameraService( 290): CameraService::connect X (pid 24546) rejected (existing client with higher priority). W/CameraBase(24546): An error occurred while connecting to camera: 0

@olafhering That's true, it is different depending on Android version and device.

So far I did not find the time to obtain a useful log file.

After some usage however I noticed that opening the "About..." window will disable the LED if the App fails to connect to the camera service. Not sure if that is intentional or just a sideeffect of something else.

Currently I run Android 7.1.2 from LineageOS. It has a built-in torchlight. I'm all set.