Search code examples
androidcameraandroid-camera2samsung-galaxy

CameraManager gives only 2 camera ids, but a device has three physical cameras. Why?


I have Samsung Galaxy S9 and I see two rear physical cameras on the device. Still, cameraManager.cameraIdList gives only two camera ID-s, one for facing camera and one for rear. How to resolve the third camera? Is it even possible?


Solution

  • You can use CameraManager#getPhysicalCameraIds() to get physical camera ids and use it with setPhysicalCameraId(). For more, visit this official documentation: https://source.android.com/devices/camera/multi-camera#examples_and_sources