what about creating a virtual device "/dev/videostream" and streaming the front camera to it by default, and when the back-lid is open switch the streaming to back-camera.