title: Problems with keeping the torch mode on while capturing picture Android Camera 2 Api?
body: <p>I am trying to capture a picture using the android Camera2 Api. Everything is working quite well. However, there is a problem that I am facing. So, when my app loads up, the torch is turned on during the preview session. But my goal is when I take the photo, the torch doesn't go off. Right now, when I take a photo , it switches to flash mode and then back to torch mode. I don't want it to flash and rather the torch stays on during the camera capture. How do I go about it?</p>
  <pre><code> mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,                                
                               CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
   if(autoflashstate==0){
      //turn on torch                                       
      mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, 
                                  CameraMetadata.FLASH_MODE_TORCH);                                     
      mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_REGIONS, 
                                  new MeteringRectangle[]{focusAreaTouch});                                        
      mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_REGIONS, 
                                  new MeteringRectangle[]{insideFocusAreaTouch});    
   }
  
   /*  else{
       //turn off flash light and then turn on torch
       unlockAutoFlash(mPreviewRequestBuilder);
                                      
       mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_TORCH);
                                      
       mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_REGIONS, new MeteringRectangle[]{focusAreaTouch});
                                      
       mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_REGIONS, new MeteringRectangle[]{insideFocusAreaTouch});
          
      
   }*/
  </code></pre>