From d2064df699469fe15c87285b6cb3f44a5c93cfb3 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 4 Nov 2013 16:34:25 +0100 Subject: [PATCH] android: Send current state of all properties while powering adapter When adapter is powered on it is expected to emit all properties so that framework could synchronize its state machine with current state of HAL. There is no need to set scan mode to none on startup as framework will set scan mode if current mode is different than desired one. --- android/adapter.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/android/adapter.c b/android/adapter.c index 9f1e45817..929e8cb6e 100644 --- a/android/adapter.c +++ b/android/adapter.c @@ -1487,16 +1487,9 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, switch (opcode) { case HAL_OP_ENABLE: - /* - * In case the controller has connectable and discoverable - * enabled, make sure to disable it first. - * - * It is enough to just clear the connectable setting since - * at the same time it will automatically clear discoverable - * setting. - */ - if (adapter->current_settings & MGMT_SETTING_CONNECTABLE) - set_mode(MGMT_OP_SET_CONNECTABLE, 0x00); + /* Framework expects all properties to be emitted while + * enabling adapter */ + get_properties(); if (adapter->current_settings & MGMT_SETTING_POWERED) { status = HAL_STATUS_DONE; -- 2.11.0