Abstract V4L2 controls into wrapper class.
This abstraction will both clean up the code in V4L2Camera.cpp, and make it
easier to implement tests in the future (by mocking over the class).
This CL only adds the class and implementation, it does not yet replace
the logic in V4L2Camera.cpp.
Also gates building the module, to prevent checkbuilds without the
proper v4l2 kernel headers from trying to build it.
BUG: 30140438
Change-Id: I4e5feee30fdf896b1f71f0df492ca313f5581e78
diff --git a/modules/camera/3_4/Android.mk b/modules/camera/3_4/Android.mk
index 074f9c2..bea434a 100644
--- a/modules/camera/3_4/Android.mk
+++ b/modules/camera/3_4/Android.mk
@@ -15,6 +15,11 @@
#
LOCAL_PATH := $(call my-dir)
+
+# Prevent the HAL from building on devices not specifically
+# requesting to use it.
+ifeq ($(USE_CAMERA_V4L2_HAL), true)
+
include $(CLEAR_VARS)
LOCAL_MODULE := camera.v4l2
@@ -43,9 +48,13 @@
LOCAL_SRC_FILES := \
Camera.cpp \
Stream.cpp \
+ StreamFormat.cpp \
V4L2Camera.cpp \
V4L2CameraHAL.cpp \
+ V4L2Wrapper.cpp \
LOCAL_CFLAGS += -Wall -Wextra -fvisibility=hidden
include $(BUILD_SHARED_LIBRARY)
+
+endif # USE_CAMERA_V4L2_HAL