For Android API >= 29 I use the next snipped to determine when a lens is monocrhome:
public boolean isMono(@NonNull final CameraCharacteristics characteristics) {
final Integer value = characteristics.get(CameraCharacteristics.SENSOR_INFO_COLOR_FILTER_ARRANGEMENT);
return (value != null)
&& ((value == CameraCharacteristics.SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO)
|| (value == CameraCharacteristics.SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR));
}
Both SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO and SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR were introduced in API 29.
What would be the way to determine if a lens is monochrome for APIs < 29?
In API 28 REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME can be used to know when a camera lens is monochrome, but in my test devices I'm not getting such capability for known monochrome lenses. I don't known if it is due to an incorrect manufacturer's implementation.
As for APIs < 28 I couldn't find any way to check.