code: public void toggleFlashMode() {
          String otherFlashMode = "";
          if (mCurrentFlash.equals(Parameters.FLASH_MODE_TORCH)) {
              otherFlashMode = Parameters.FLASH_MODE_OFF;
          } else {
              otherFlashMode = Parameters.FLASH_MODE_TORCH;
          }
          requestFlash(otherFlashMode);
      }
docs: Toggle the flash mode between TORCH and OFF.
  This will take effect immediately or as soon
  as the camera preview becomes active.
  <p/>
  Called from UI thread