Detect if camera is already open
===

I'm making an app that use the flashlight of the camera.

I open the camera with :

     Camera cam = Camera.open();

When I start my app, if another app is already using the camera, I get an error :

    java.lang.RuntimeException: Fail to connect to camera service

First, is there any way to still use the camera if it has already been opened by another app ? 

If it's not possible, I would like my app to display a message "Camera already in use" instead of crashing.

In this case, how can I detect if the camera is already opened by another app ? 