title: How to enable flash light in Camera2 API without building new session?
body: <p>I'm working on app based on Camera2 API. And I want to add feature of enabling/disabling flash light in this app.</p>
  
  <p>There are some problems. I use 3 different threads for rendering and so one and communicate between this threads via Handlers. When user pree flash light button I want to enable it, and I can do it like this:</p>
  
  <pre><code> mPreviewBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
   mPreviewSession.setRepeatingRequest(mPreviewBuilder.build(), null, null);
  </code></pre>
  
  <p>But , as I understand creating new prewiew session is expensive procedure, and I also don't want to loose any frames from camera.</p>
  
  <p>Is there any way of enabling flash light without building new session? Or I'm wrong and it doesn't take a lot of resources at all?</p>
  
  <p>I also wonder how it's implemented in standart camera applications. Maybe there is any  open source code?</p>
  
  <p><em>Thanks everyone for answers in advance!</em></p>