core/service: Allow disconnected -> connected state change
PATCH 1/1 core/service: Allow disconnected -> connected state change
By ignoring case where service->state == BTD_SERVICE_STATE_DISCONNECTED in btd_service_connecting_complete(), state_callbacks don't get executed. Such case occurs when e.g., phone using a2dp-source profile connects to the bluez. Because no state_callbacks are executed (including one added by policy plugin) no reconnection is attempted after connection timeout, although if situation is reversed (bluez connects to the phone) reconnection works.
--- src/service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/service.c +2 -1
@@ -353,7 +353,8 @@ bool btd_service_remove_state_cb(unsigned int id)void btd_service_connecting_complete (struct btd_service *service,int err) { -if (service->state !=BTD_SERVICE_STATE_CONNECTING ) +if (service->state !=BTD_SERVICE_STATE_DISCONNECTED && + service->state !=BTD_SERVICE_STATE_CONNECTING )return ;if (err ==0 )
Johan Hedberg
AppliedHi Miroslav,
Quoted 10 lines · Miroslav Koskar
By ignoring case where
service->state==BTD_SERVICE_STATE_DISCONNECTEDinbtd_service_connecting_complete(),state_callbacksdon't get executed. Such case occurs when e.g., phone using a2dp-source profile connects to the bluez. Because nostate_callbacksare executed (including one added by policy plugin) no reconnection is attempted after connection timeout, although if situation is reversed (bluez connects to the phone) reconnection works.--- src/service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied. Thanks.
Johan