Our app runs as a background service, continuously getting the images from the frontal camera and then doing things with the images. However, when the user tries to open another app that uses the camera, two things happen: either the new app crashes and ours continues, or our crashes and the new one gets access to the camera.
Now, if our app loses control over the camera, there's an exception that we can catch, and we can then start trying to access it until we get access and things go back to normal.
The problem is when the other apps crash because of ours. Is there any way to detect this, so we can pause our app until we can access the camera again?