mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-26 21:54:33 +08:00
android/hal: Use defined function to check that interface is ready
This commit is contained in:
parent
39bf745e92
commit
81af6f918c
@ -78,10 +78,15 @@ void bt_thread_disassociate(void)
|
||||
bt_hal_cbacks->thread_evt_cb(DISASSOCIATE_JVM);
|
||||
}
|
||||
|
||||
static bool interface_ready(void)
|
||||
{
|
||||
return bt_hal_cbacks != NULL;
|
||||
}
|
||||
|
||||
/* will be called from notification thread context */
|
||||
void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len)
|
||||
{
|
||||
if (!bt_hal_cbacks)
|
||||
if (!interface_ready())
|
||||
return;
|
||||
|
||||
switch (opcode) {
|
||||
@ -97,11 +102,6 @@ void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len)
|
||||
}
|
||||
}
|
||||
|
||||
static bool interface_ready(void)
|
||||
{
|
||||
return bt_hal_cbacks != NULL;
|
||||
}
|
||||
|
||||
static int init(bt_callbacks_t *callbacks)
|
||||
{
|
||||
struct hal_cmd_register_module cmd;
|
||||
|
Loading…
Reference in New Issue
Block a user