Missing cameras in cameraIdList

Viewed 382

halo,

i have an issue with my app i'm trying to get all cameras of my phone. my app detects only 2 cameras i'm using :

val manager = context!!.getSystemService(Context.CAMERA_SERVICE) as CameraManager
var listOfCamer as = manager.cameraIdList;

When I tried openCamera (https://opencamera.sourceforge.io/help.html), it detects 4 cameras! Or we use the same method/class

CameraManager manager = (CameraManager)context.getSystemService(Context.CAMERA_SERVICE);
            try {
                return manager.getCameraIdList().length;
            }

am I missing some config / permissions?

1 Answers

(Android 10 or higher) Hide physical sub-cameras from getCameraIdList. This reduces the number of cameras that can be directly opened by apps, eliminating the need for apps to have complex camera selection logic.

I think this is the reason. Try the same with old Camera API (though it is deprecated now), perhaps, it would allow you to see all your 4 devices.

Related