title: Android camera2 manual flash doesn't always work
body: <p>I'm using the new camera2 api on Android 6.1, sdk 23.</p>
  
  <p>I have two requests: a preview and a still image capture request.  I'd like to make it so that the flash goes off on every still image request, but without any pre-flash.  Right now, my request looks like this:</p>
  
  <pre><code>CaptureRequest.Builder requester = mCameraDevice.createCaptureRequest(mCameraDevice.TEMPLATE_STILL_CAPTURE);
          requester.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
          requester.set(CaptureRequest.CONTROL_CAPTURE_INTENT, CaptureRequest.CONTROL_CAPTURE_INTENT_STILL_CAPTURE);
          requester.set(CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION, CaptureRequest.CONTROL_AE_STATE_FLASH_REQUIRED);
          requester.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER, CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL);
          requester.addTarget(mCaptureBuffer.getSurface());
  
  mCaptureSession.capture(requester.build(), null, null);
  </code></pre>
  
  <p>It seems to work on one phone (a Motorola Moto G) but not on another (a Nexus 5 -- the flash doesn't turn on at all).  I know the Nexus' flash works because I can trigger it with other camera apps, so I'm guessing there are some defaults that I'm not setting.</p>
  
  <p>Is there another way I can do this / more flags I can set?</p>
  
  <p>Thanks!</p>
  
  <p>Edit:
  <hr />
  It turns out that a lot of the trouble I was having stemmed from working with devices that had only <code>LIMITED</code> support for camera2.  Just because you can access the camera using camera 2 doesn't mean you can control all the features.  Check out <a href="https://stackoverflow.com/a/30967026/1115876">this</a> answer for more</p>