title: Taking picture with flash on camera2 gives picture "after" flash occured (i.e without flash)
body: <p>I based my code on the sample from Google Camera2-Basic and added flash always support. But It looks like the picture is taken right after the flash has occur. I (almost) always get non flashed picture, even though the flash is triggered.</p>
  
  <p>The modified preview request builder : </p>
  
  <pre><code>mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
  </code></pre>
  
  <p>And I also added this control mode to captureStillPicture()</p>
  
  <pre><code>captureBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
  </code></pre>
  
  <p>and modified the process() switch with : </p>
  
  <pre><code>       case STATE_WAITING_PRECAPTURE: {
            // CONTROL_AE_STATE can be null on some devices
            Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
            Log.i(TAG, "aeState = " + aeState);
            if (aeState == null ||
                aeState == CaptureResult.CONTROL_AE_STATE_PRECAPTURE ||
                aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED ||
                aeState == CaptureRequest.CONTROL_AE_STATE_FLASH_REQUIRED) {
              mState = STATE_WAITING_NON_PRECAPTURE;
            }
            break;
          }
  </code></pre>