summaryrefslogtreecommitdiffstats
path: root/sensors
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2016-06-21 10:03:09 +0200
committerDavid 'Digit' Turner <digit@google.com>2016-06-21 10:03:09 +0200
commit09c319886ea246a7e78ce2479db4de1d1a36865f (patch)
tree6fd295e07287b73c9871a1878cd5445b867fd04d /sensors
parent07e51c3536f5be496facac0e8f9ad7bf1d695f32 (diff)
parentd6b1ea816edbe6d3bef383774b729a6adcf1bd75 (diff)
downloadandroid_device_generic_goldfish-09c319886ea246a7e78ce2479db4de1d1a36865f.tar.gz
android_device_generic_goldfish-09c319886ea246a7e78ce2479db4de1d1a36865f.tar.bz2
android_device_generic_goldfish-09c319886ea246a7e78ce2479db4de1d1a36865f.zip
resolve merge conflicts of d6b1ea8 to stage-aosp-master
Change-Id: Ib0b4f368dae0d8c76a1c031f24785318566216f0
Diffstat (limited to 'sensors')
-rw-r--r--sensors/sensors_qemu.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/sensors/sensors_qemu.c b/sensors/sensors_qemu.c
index b0e858c..7175a44 100644
--- a/sensors/sensors_qemu.c
+++ b/sensors/sensors_qemu.c
@@ -23,9 +23,9 @@
*/
-/* we connect with the emulator through the "sensors" qemud service
+/* we connect with the emulator through the "sensors" qemu pipe service
*/
-#define SENSORS_SERVICE_NAME "sensors"
+#define SENSORS_SERVICE_NAME "pipe:qemud:sensors"
#define LOG_TAG "QemuSensors"
@@ -45,7 +45,7 @@
#define E(...) ALOGE(__VA_ARGS__)
-#include <hardware/qemud.h>
+#include <system/qemu_pipe.h>
/** SENSOR IDS AND NAMES
**/
@@ -152,9 +152,9 @@ typedef struct SensorDevice {
* from different threads, and poll() is blocking.
*
* Note that the emulator's sensors service creates a new client for each
- * connection through qemud_channel_open(), where each client has its own
+ * connection through qemu_pipe_open(), where each client has its own
* delay and set of activated sensors. This precludes calling
- * qemud_channel_open() on each request, because a typical emulated system
+ * qemu_pipe_open() on each request, because a typical emulated system
* will do something like:
*
* 1) On a first thread, de-activate() all sensors first, then call poll(),
@@ -174,7 +174,7 @@ typedef struct SensorDevice {
static int sensor_device_get_fd_locked(SensorDevice* dev) {
/* Create connection to service on first call */
if (dev->fd < 0) {
- dev->fd = qemud_channel_open(SENSORS_SERVICE_NAME);
+ dev->fd = qemu_pipe_open(SENSORS_SERVICE_NAME);
if (dev->fd < 0) {
int ret = -errno;
E("%s: Could not open connection to service: %s", __FUNCTION__,
@@ -196,7 +196,7 @@ static int sensor_device_send_command_locked(SensorDevice* dev,
}
int ret = 0;
- if (qemud_channel_send(fd, cmd, strlen(cmd)) < 0) {
+ if (qemu_pipe_frame_send(fd, cmd, strlen(cmd)) < 0) {
ret = -errno;
E("%s(fd=%d): ERROR: %s", __FUNCTION__, fd, strerror(errno));
}
@@ -267,7 +267,7 @@ static int sensor_device_poll_event_locked(SensorDevice* dev)
/* read the next event */
char buff[256];
- int len = qemud_channel_recv(fd, buff, sizeof(buff) - 1U);
+ int len = qemu_pipe_frame_recv(fd, buff, sizeof(buff) - 1U);
/* re-acquire the lock to modify the device state. */
pthread_mutex_lock(&dev->lock);
@@ -657,22 +657,23 @@ static struct sensor_t sSensorList[MAX_NUM_SENSORS];
static int sensors__get_sensors_list(struct sensors_module_t* module __unused,
struct sensor_t const** list)
{
- int fd = qemud_channel_open(SENSORS_SERVICE_NAME);
+ int fd = qemu_pipe_open(SENSORS_SERVICE_NAME);
char buffer[12];
int mask, nn, count;
int ret = 0;
if (fd < 0) {
- E("%s: no qemud connection", __FUNCTION__);
+ E("%s: no qemu pipe connection", __FUNCTION__);
goto out;
}
- ret = qemud_channel_send(fd, "list-sensors", -1);
+ static const char kListSensors[] = "list-sensors";
+ ret = qemu_pipe_frame_send(fd, kListSensors, sizeof(kListSensors) - 1);
if (ret < 0) {
E("%s: could not query sensor list: %s", __FUNCTION__,
strerror(errno));
goto out;
}
- ret = qemud_channel_recv(fd, buffer, sizeof buffer-1);
+ ret = qemu_pipe_frame_recv(fd, buffer, sizeof buffer-1);
if (ret < 0) {
E("%s: could not receive sensor list: %s", __FUNCTION__,
strerror(errno));