To get supported hardware level of the camera device we can use those methods of Camera2
API, it requires CAMERA_ID
to get this info.
Does it mean that each camera of the smartphone can has different hardware level? Or is it guaranteed that all cameras have the same hardware level and I can use any CAMERA_ID
(front or back) of availables camera ids (manager.cameraIdList
)?
val cameraManager = context.getSystemService(Context.CAMERA_SERVICE) as CameraManager
val cameraCharacteristics = cameraManager.getCameraCharacteristics(CAMERA_ID)
val level = cameraCharacteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL)
No, every camera device has its own supported hardware level. There's no guarantee the front and back cameras support the same features, so you need to check them all individually.