Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw

LOCAL_CFLAGS := -DLOG_TAG=\"SensorsHal\" -Wall
ifeq ($(MEDIATION_HAL_DISABLE_STATIC_SENSOR_LIST), true)
LOCAL_CFLAGS += -DDISABLE_STATIC_SENSOR_LIST
endif

LOCAL_SRC_FILES := sensor_hal.cpp iio-client.cpp \
custom-libiio-client/xml.c \
Expand Down
6 changes: 6 additions & 0 deletions sensor_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

static bool is_meta_data_pending = false;
static iioClient iioc;
#ifndef DISABLE_STATIC_SENSOR_LIST
static const struct sensor_t sSensorList[MAX_SENSOR] = {
{"Accelerometer",
"Intel",
Expand Down Expand Up @@ -191,6 +192,7 @@ static const struct sensor_t sSensorList[MAX_SENSOR] = {
{},
},
};
#endif

static int open_sensors(const struct hw_module_t* module, const char* id,
struct hw_device_t** device);
Expand All @@ -199,9 +201,13 @@ static int sensors__get_sensors_list(struct sensors_module_t* module,
struct sensor_t const** list)
{
UNUSED(module);
#ifndef DISABLE_STATIC_SENSOR_LIST
*list = sSensorList;

return MAX_SENSOR;
#else
return 0;
#endif
}

static struct hw_module_methods_t sensors_module_methods = {
Expand Down