From a6b44992f2626469bd99037ae1c6733cb75d610e Mon Sep 17 00:00:00 2001 From: "Kevin F. Haggerty" Date: Thu, 20 Sep 2018 22:46:44 -0600 Subject: [PATCH] msm8226-common: sensors: Update multihal with P changes Change-Id: Iee33e9043e5f4eb9b5ff8af562800e0392c041b5 --- sensors/Android.bp | 8 ++++++-- sensors/Android.mk | 2 +- sensors/multihal.cpp | 10 +--------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sensors/Android.bp b/sensors/Android.bp index b8b2949..b4707b9 100644 --- a/sensors/Android.bp +++ b/sensors/Android.bp @@ -3,7 +3,7 @@ cc_library_static { vendor: true, srcs: [ "multihal.cpp", - "SensorEventQueue.cpp" + "SensorEventQueue.cpp", ], header_libs: [ "libhardware_headers", @@ -12,7 +12,11 @@ cc_library_static { "liblog", "libcutils", "libutils", - "libdl" + "libdl", ], export_include_dirs: ["."], + cflags: [ + "-Wall", + "-Werror", + ], } diff --git a/sensors/Android.mk b/sensors/Android.mk index 6d65d20..6889f5b 100644 --- a/sensors/Android.mk +++ b/sensors/Android.mk @@ -23,7 +23,7 @@ LOCAL_MODULE := sensors.$(TARGET_BOARD_PLATFORM) LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_PROPRIETARY_MODULE := true -LOCAL_CFLAGS := -DLOG_TAG=\"MultiHal\" +LOCAL_CFLAGS := -Wall -Werror -DLOG_TAG=\"MultiHal\" LOCAL_SRC_FILES := \ multihal.cpp \ diff --git a/sensors/multihal.cpp b/sensors/multihal.cpp index 05de3e9..9af068f 100644 --- a/sensors/multihal.cpp +++ b/sensors/multihal.cpp @@ -406,6 +406,7 @@ static int device__close(struct hw_device_t *dev) { if (ctx != NULL) { int retval = ctx->close(); delete ctx; + return retval; } 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, 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. * The vector must not be null.