Switching Camera from Front Facing to Back Facing makes Flash options stop working
I tried the Demo app on Samsung Galaxy S7, after switching the camera from Front Facing to Back Facing, the Flash option doesn't work anymore. If I changed the camera to Flash On, it won't give any Flash when taking picture.
Initially the camera is back facing and the Flash option works well. But after switching it to Front facing and then switching back to Back Facing, Flash option stops working.
Steps to replicate:
- Open Demo App, switch Camera to Front Facing, then switch it to Back Facing.
- Change Flash option to Flash On, take a picture and you will notice there is no Flash.
The problem is that front camera does not support autofocus and switching to front camera will set autofocus to false. Switching back to back camera, autofocus will still be false. Autofocus affects the flash behavior, because when taking a photo, the precapture metering sequence will be started if autofocus is true. The precapture metering sequence may trigger the flash (I think it depends on the auto exposure mode). Anyway, setting autofocus to true when switching to back camera should fix the problem.