msm8226-common: sensors: Update multihal with P changes

Change-Id: Iee33e9043e5f4eb9b5ff8af562800e0392c041b5
This commit is contained in:
Kevin F. Haggerty 2018-09-20 22:46:44 -06:00 committed by Francescodario Cuzzocrea
parent 39f1b3c1b0
commit a6b44992f2
3 changed files with 8 additions and 12 deletions

View file

@ -3,7 +3,7 @@ cc_library_static {
vendor: true, vendor: true,
srcs: [ srcs: [
"multihal.cpp", "multihal.cpp",
"SensorEventQueue.cpp" "SensorEventQueue.cpp",
], ],
header_libs: [ header_libs: [
"libhardware_headers", "libhardware_headers",
@ -12,7 +12,11 @@ cc_library_static {
"liblog", "liblog",
"libcutils", "libcutils",
"libutils", "libutils",
"libdl" "libdl",
], ],
export_include_dirs: ["."], export_include_dirs: ["."],
cflags: [
"-Wall",
"-Werror",
],
} }

View file

@ -23,7 +23,7 @@ LOCAL_MODULE := sensors.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_PROPRIETARY_MODULE := true LOCAL_PROPRIETARY_MODULE := true
LOCAL_CFLAGS := -DLOG_TAG=\"MultiHal\" LOCAL_CFLAGS := -Wall -Werror -DLOG_TAG=\"MultiHal\"
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
multihal.cpp \ multihal.cpp \

View file

@ -406,6 +406,7 @@ static int device__close(struct hw_device_t *dev) {
if (ctx != NULL) { if (ctx != NULL) {
int retval = ctx->close(); int retval = ctx->close();
delete ctx; delete ctx;
return retval;
} }
return 0; return 0;
} }
@ -456,15 +457,6 @@ static int device__inject_sensor_data(struct sensors_poll_device_1 *dev,
static int open_sensors(const struct hw_module_t* module, const char* name, static int open_sensors(const struct hw_module_t* module, const char* name,
struct hw_device_t** device); struct hw_device_t** device);
static bool starts_with(const char* s, const char* prefix) {
if (s == NULL || prefix == NULL) {
return false;
}
size_t s_size = strlen(s);
size_t prefix_size = strlen(prefix);
return s_size >= prefix_size && strncmp(s, prefix, prefix_size) == 0;
}
/* /*
* Adds valid paths from the config file to the vector passed in. * Adds valid paths from the config file to the vector passed in.
* The vector must not be null. * The vector must not be null.