diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2013-10-25 14:34:46 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-10-25 16:08:04 +0300 |
commit | 39bf745e92b79891c43b42de662fb41c42b3b30e (patch) | |
tree | 0dd39ae73080586242f797dabfef2f17fbc47e68 /android/hal-ipc.c | |
parent | d52939fde909bae869bad70894dd4407e1337e5f (diff) | |
download | bluez-39bf745e92b79891c43b42de662fb41c42b3b30e.tar.gz |
android/hal: Associate thread to Java
Without thread assiciation callbacks are not received by Java.
They are blocked by JNI:
E/BluetoothServiceJni( 2844): Callback env check fail: env: 0x0, callback: 0x0
E/BluetoothServiceJni( 2844): Callback: 'adapter_state_change_callback' is not
called on the correct thread
Diffstat (limited to 'android/hal-ipc.c')
-rw-r--r-- | android/hal-ipc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/android/hal-ipc.c b/android/hal-ipc.c index c7764aba4..57238410d 100644 --- a/android/hal-ipc.c +++ b/android/hal-ipc.c @@ -67,6 +67,8 @@ static void *notification_handler(void *data) ssize_t ret; int fd; + bt_thread_associate(); + while (true) { memset(&msg, 0, sizeof(msg)); memset(buf, 0, sizeof(buf)); @@ -133,6 +135,8 @@ static void *notification_handler(void *data) close(notif_sk); notif_sk = -1; + bt_thread_disassociate(); + DBG("exit"); return NULL; |