diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2014-05-20 15:37:58 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-06-12 13:04:31 +0200 |
commit | 1c393c18d0bf29f2f216096d33fd14a733baf055 (patch) | |
tree | c2c8d844671053922674c3ff264aa43fd22c601b /android/hal-bluetooth.c | |
parent | 5272cc4976acf7e0d3ab3c0207b4fe7d4e29bc66 (diff) | |
download | bluez-1c393c18d0bf29f2f216096d33fd14a733baf055.tar.gz |
android/hal-ipc: Split IPC init and accept to separate functions
This allows to perform custom action between listening and accepting
eg starting bluetoothd.
Diffstat (limited to 'android/hal-bluetooth.c')
-rw-r--r-- | android/hal-bluetooth.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index c2a1085b9..a220328a4 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -415,12 +415,16 @@ static int init(bt_callbacks_t *callbacks) if (interface_ready()) return BT_STATUS_DONE; - bt_hal_cbacks = callbacks; - hal_ipc_register(HAL_SERVICE_ID_BLUETOOTH, ev_handlers, sizeof(ev_handlers)/sizeof(ev_handlers[0])); - if (!hal_ipc_init(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH))) { + if (!hal_ipc_init(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH))) + return BT_STATUS_FAIL; + + bt_hal_cbacks = callbacks; + + if (!hal_ipc_accept()) { + hal_ipc_cleanup(); bt_hal_cbacks = NULL; return BT_STATUS_FAIL; } |