From 85a71aa4e1209f123701bae1455debbcf4aadcce Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 11 Jun 2014 16:12:40 +0200 Subject: [PATCH] android/ipc: Add support for sending FD in notifications --- android/ipc.c | 8 +++++++- android/ipc.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/android/ipc.c b/android/ipc.c index fc58a1c93..2e674284e 100644 --- a/android/ipc.c +++ b/android/ipc.c @@ -404,11 +404,17 @@ void ipc_send_rsp_full(struct ipc *ipc, uint8_t service_id, uint8_t opcode, void ipc_send_notif(struct ipc *ipc, uint8_t service_id, uint8_t opcode, uint16_t len, void *param) { + return ipc_send_notif_with_fd(ipc, service_id, opcode, len, param, -1); +} + +void ipc_send_notif_with_fd(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint16_t len, void *param, int fd) +{ if (!ipc || !ipc->notif_io) return; ipc_send(g_io_channel_unix_get_fd(ipc->notif_io), service_id, opcode, - len, param, -1); + len, param, fd); } void ipc_register(struct ipc *ipc, uint8_t service, diff --git a/android/ipc.h b/android/ipc.h index e97f0e6c7..fd2b98521 100644 --- a/android/ipc.h +++ b/android/ipc.h @@ -42,6 +42,9 @@ void ipc_send_rsp_full(struct ipc *ipc, uint8_t service_id, uint8_t opcode, uint16_t len, void *param, int fd); void ipc_send_notif(struct ipc *ipc, uint8_t service_id, uint8_t opcode, uint16_t len, void *param); +void ipc_send_notif_with_fd(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint16_t len, void *param, int fd); + void ipc_register(struct ipc *ipc, uint8_t service, const struct ipc_handler *handlers, uint8_t size); void ipc_unregister(struct ipc *ipc, uint8_t service); -- 2.11.0