diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-08-08 14:47:04 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-08-08 14:47:04 -0700 |
commit | d8ad6c98086c410243e0e8ad8285f02d6b696bd6 (patch) | |
tree | 69649409778f147c482a267dd51b48c9ffad6fd7 /reference-ril | |
parent | 3c3569d30c274c5d5ff040d3379427cea3175d06 (diff) | |
parent | 988d3d7181473e36df8679368b06d0fb766c52e4 (diff) | |
download | android_hardware_ril-d8ad6c98086c410243e0e8ad8285f02d6b696bd6.tar.gz android_hardware_ril-d8ad6c98086c410243e0e8ad8285f02d6b696bd6.tar.bz2 android_hardware_ril-d8ad6c98086c410243e0e8ad8285f02d6b696bd6.zip |
resolved conflicts for merge of 988d3d71 to honeycomb-plus-aosp
Change-Id: I85178afbca0b8b51eb3890958b063a70a1b33b96
Diffstat (limited to 'reference-ril')
-rw-r--r-- | reference-ril/reference-ril.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/reference-ril/reference-ril.c b/reference-ril/reference-ril.c index 02a7e12..ce2b0ce 100644 --- a/reference-ril/reference-ril.c +++ b/reference-ril/reference-ril.c @@ -35,6 +35,7 @@ #include <sys/system_properties.h> #include "ril.h" +#include "hardware/qemu_pipe.h" #define LOG_TAG "RIL" #include <utils/Log.h> @@ -2072,21 +2073,28 @@ mainLoop(void *param) fd = socket_loopback_client(s_port, SOCK_STREAM); } else if (s_device_socket) { if (!strcmp(s_device_path, "/dev/socket/qemud")) { - /* Qemu-specific control socket */ - fd = socket_local_client( "qemud", - ANDROID_SOCKET_NAMESPACE_RESERVED, - SOCK_STREAM ); - if (fd >= 0 ) { - char answer[2]; - - if ( write(fd, "gsm", 3) != 3 || - read(fd, answer, 2) != 2 || - memcmp(answer, "OK", 2) != 0) - { - close(fd); - fd = -1; - } - } + /* Before trying to connect to /dev/socket/qemud (which is + * now another "legacy" way of communicating with the + * emulator), we will try to connecto to gsm service via + * qemu pipe. */ + fd = qemu_pipe_open("qemud:gsm"); + if (fd < 0) { + /* Qemu-specific control socket */ + fd = socket_local_client( "qemud", + ANDROID_SOCKET_NAMESPACE_RESERVED, + SOCK_STREAM ); + if (fd >= 0 ) { + char answer[2]; + + if ( write(fd, "gsm", 3) != 3 || + read(fd, answer, 2) != 2 || + memcmp(answer, "OK", 2) != 0) + { + close(fd); + fd = -1; + } + } + } } else fd = socket_local_client( s_device_path, |