diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-02-01 07:18:23 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-02-01 07:18:23 -0800 |
commit | f4d4ca164dea606cee27e1f68d4742a3c57b0954 (patch) | |
tree | 1d8d2bbc7d13742129a0faad57ea51931c2e0080 /android/protocol/user-events-proxy.c | |
parent | a7880fe783781bbedf998916791ebd70fb252b88 (diff) | |
parent | 85276806ec6ac969d7befa2496c1de59adaaac74 (diff) | |
download | external_qemu-f4d4ca164dea606cee27e1f68d4742a3c57b0954.zip external_qemu-f4d4ca164dea606cee27e1f68d4742a3c57b0954.tar.gz external_qemu-f4d4ca164dea606cee27e1f68d4742a3c57b0954.tar.bz2 |
Merge "Refactor attach-UI service"
Diffstat (limited to 'android/protocol/user-events-proxy.c')
-rw-r--r-- | android/protocol/user-events-proxy.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/android/protocol/user-events-proxy.c b/android/protocol/user-events-proxy.c index d35012f..2049b68 100644 --- a/android/protocol/user-events-proxy.c +++ b/android/protocol/user-events-proxy.c @@ -34,22 +34,6 @@ typedef struct UserEventsProxy { /* One and only one user events client instance. */ static UserEventsProxy _userEventsProxy = { 0 }; -/* Destroys CoreCmdProxy instance. */ -static void -_userEventsProxy_destroy(void) -{ - if (_userEventsProxy.sync_writer != NULL) { - syncsocket_close(_userEventsProxy.sync_writer); - syncsocket_free(_userEventsProxy.sync_writer); - _userEventsProxy.sync_writer = NULL; - } - if (_userEventsProxy.core_connection != NULL) { - core_connection_close(_userEventsProxy.core_connection); - core_connection_free(_userEventsProxy.core_connection); - _userEventsProxy.core_connection = NULL; - } -} - /* Sends an event to the core. * Parameters: * event - Event type. Must be one of the AUSER_EVENT_XXX. @@ -107,7 +91,7 @@ userEventsProxy_create(SockAddress* console_socket) _userEventsProxy.sync_writer = syncsocket_init(_userEventsProxy.sock); if (_userEventsProxy.sync_writer == NULL) { derror("Unable to initialize UserEventsProxy writer: %s\n", errno_str); - _userEventsProxy_destroy(); + userEventsProxy_destroy(); return -1; } @@ -125,6 +109,20 @@ userEventsProxy_create(SockAddress* console_socket) } void +userEventsProxy_destroy(void) +{ + if (_userEventsProxy.sync_writer != NULL) { + syncsocket_close(_userEventsProxy.sync_writer); + syncsocket_free(_userEventsProxy.sync_writer); + _userEventsProxy.sync_writer = NULL; + } + if (_userEventsProxy.core_connection != NULL) { + core_connection_close(_userEventsProxy.core_connection); + core_connection_free(_userEventsProxy.core_connection); + _userEventsProxy.core_connection = NULL; + } +} +void user_event_keycodes(int *kcodes, int count) { int nn; |