What I want to achieve is capturing a picture without showing the preview, sending directly the output to an ImageReader.
I have used the Camera2Basic example
I've been struggling with CAMERA2 API for a long time, looking for how to take pictures without preview from all available cameras on the device.
I ended up creating a project on GitHub that does exactly what you want (and maybe more)! https://github.com/hzitoun/android-camera2-secret-picture-taker
Hope that helped :)