Currently I'm using the CameraX library in my Android project. I'd like to decide programmatically if the given camera instance supports auto-focus. How can I get this info?
I could solve it by extending the CameraCharacteristics class in the following way:
import android.hardware.camera2.CameraCharacteristics
val CameraCharacteristics.hasAutoFocus: Boolean
get() = get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF) != 0