modules: camera: Hide HAL symbols DO NOT MERGE
Explicitly hide all symbols from being exported from the camera HAL
except the symbol required to load the module.
Change-Id: I940b24b8d3895f46e63df3c28e43b8cb012bd637
diff --git a/modules/camera/Android.mk b/modules/camera/Android.mk
index 44d7212..eebffc1 100644
--- a/modules/camera/Android.mk
+++ b/modules/camera/Android.mk
@@ -32,7 +32,7 @@
libcutils \
liblog \
-LOCAL_CFLAGS += -Wall -Wextra
+LOCAL_CFLAGS += -Wall -Wextra -fvisibility=hidden
LOCAL_MODULE_TAGS := optional
diff --git a/modules/camera/CameraHAL.cpp b/modules/camera/CameraHAL.cpp
index 22c7aef..abc3278 100644
--- a/modules/camera/CameraHAL.cpp
+++ b/modules/camera/CameraHAL.cpp
@@ -64,9 +64,8 @@
return gCameras[id].getCameraInfo(info);
}
-static int open_device(const hw_module_t* module,
- const char* name,
- hw_device_t** device)
+static int open_device(const hw_module_t* module, const char* name,
+ hw_device_t** device)
{
ALOGV("%s: module=%p, name=%s, device=%p", __func__, module, name, device);
char *nameEnd;
@@ -88,7 +87,7 @@
open : open_device
};
-camera_module_t HAL_MODULE_INFO_SYM = {
+camera_module_t HAL_MODULE_INFO_SYM __attribute__ ((visibility("default"))) = {
common : {
tag : HARDWARE_MODULE_TAG,
module_api_version : CAMERA_MODULE_API_VERSION_2_0,