Find V4L2 devices from /dev/video*.
Since V4L2CameraHAL now populates its list of cameras,
also added a necessary piece of metadata that was
causing cameraservice to crash.
BUG: 29160300
TEST: Ran on rpi3. HAL finds dev/video* nodes. When a
sym link (/dev/video5 -> /dev/video0) was added, the HAL
correctly did not add a 3rd device.
Change-Id: I95656ac9c062b193c12712b1c73e888bf1f1a961
diff --git a/modules/camera/3_4/V4L2Camera.cpp b/modules/camera/3_4/V4L2Camera.cpp
index 1529756..aa65cdf 100644
--- a/modules/camera/3_4/V4L2Camera.cpp
+++ b/modules/camera/3_4/V4L2Camera.cpp
@@ -37,6 +37,9 @@
android::CameraMetadata metadata(1);
// TODO(b/29214516): fill this in.
+ uint8_t scene_mode = ANDROID_CONTROL_SCENE_MODE_DISABLED;
+ metadata.update(ANDROID_CONTROL_AVAILABLE_SCENE_MODES, &scene_mode, 1);
+
return metadata.release();
}