I got a strange situation.
I work with the example of Google camera2API and I need to make the flash work every time the user takes a photo.
For this, I changed one line in the method
private void setAutoFlash(CaptureRequest.Builder requestBuilder) { if (mFlashSupported) { // requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH); requestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH); } } I changed CONTROL_AE_MODE_ON_AUTO_FLASH to CONTROL_AE_MODE_ON_ALWAYS_FLASH.
I am testing the code on three Meizu MX5 , Samsung S5 and Samsung S6 So that's what happened, now the Meizu MX5 and Samsung S5 work as expected and the flash fires with each photo.
But for Samsung S6 this approach does not work, and when the user clicks on the Make photo button, the flash fires and that's it ... The application hangs ...
What I found out: the setAutoFlash() method is called in the code in three different methods
captureStillPicture()unlockFocus()onConfigured()
So if in the captureStillPicture() method captureStillPicture() block the call to the setAutoFlash() method, then the application works correctly for the Samsung S6 , but then the flash does not work on the Meizu MX5 and Samsung S5 .
What am I doing wrong?