diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-31 08:02:10 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-31 08:02:10 +0000 |
commit | feaa98e24b86cd7d68b53d02063a675a55719a45 (patch) | |
tree | 9c6eabcfe9acdce4de758ef38fa4723a3d2430ad | |
parent | 3e55928d8f59017ef627cd85bab55320a5051e96 (diff) | |
parent | 945af7cc3cd95267ee9ab6e2045a410d60c8f3b0 (diff) | |
download | libhardware-feaa98e24b86cd7d68b53d02063a675a55719a45.tar.gz |
release-request-31f776a2-f093-4abe-9235-1702f8bafc9d-for-git_oc-dr1-release-4054002 snap-temp-L42500000069020014
Change-Id: I67c9e4134bfa72e983f4a0068ed8a6f4e99697c3
-rw-r--r-- | hardware.c | 9 | ||||
-rw-r--r-- | include/hardware/bluetooth.h | 5 | ||||
-rw-r--r-- | modules/sensors/multihal.cpp | 6 |
3 files changed, 17 insertions, 3 deletions
@@ -82,7 +82,14 @@ static int load(const char *id, * dlopen returns. Since RTLD_GLOBAL is not or'd in with * RTLD_NOW the external symbols will not be global */ - handle = android_load_sphal_library(path, RTLD_NOW); + if (strncmp(path, "/system/", 8) == 0) { + /* If the library is in system partition, no need to check + * sphal namespace. Open it with dlopen. + */ + handle = dlopen(path, RTLD_NOW); + } else { + handle = android_load_sphal_library(path, RTLD_NOW); + } if (handle == NULL) { char const *err_str = dlerror(); ALOGE("load: module=%s\n%s", path, err_str?err_str:"unknown"); diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h index b706e8ad..6e287e6d 100644 --- a/include/hardware/bluetooth.h +++ b/include/hardware/bluetooth.h @@ -35,7 +35,7 @@ __BEGIN_DECLS #define BT_STACK_TEST_MODULE_ID "bluetooth_test" -/* Bluetooth profile interface IDs */ +/** Bluetooth profile interface IDs */ #define BT_PROFILE_HANDSFREE_ID "handsfree" #define BT_PROFILE_HANDSFREE_CLIENT_ID "handsfree_client" @@ -52,6 +52,9 @@ __BEGIN_DECLS #define BT_PROFILE_AV_RC_ID "avrcp" #define BT_PROFILE_AV_RC_CTRL_ID "avrcp_ctrl" +/** Bluetooth test interface IDs */ +#define BT_TEST_INTERFACE_MCAP_ID "mcap_test" + /** Bluetooth Address */ typedef struct { uint8_t address[6]; diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index 4d6013fa..1cea7aeb 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -445,7 +445,11 @@ int sensors_poll_context_t::inject_sensor_data(const sensors_event_t *data) { sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(data->sensor); if (halIsAPILevelCompliant(this, data->sensor, SENSORS_DEVICE_API_VERSION_1_4) && local_handle >= 0 && v1) { - retval = v1->inject_sensor_data(v1, data); + // if specific sensor is used, we have to replace global sensor handle + // with local one, before passing to concrete HAL + sensors_event_t data_copy = *data; + data_copy.sensor = local_handle; + retval = v1->inject_sensor_data(v1, &data_copy); } else { ALOGE("IGNORED inject_sensor_data(type=%d, handle=%d) call to non-API-compliant sensor", data->type, data->sensor); |