diff --git a/plugins/policy.c b/plugins/policy.c
index bf93df0..051db82 100644
--- a/plugins/policy.c
+++ b/plugins/policy.c
/* Check if service initiate the connection then proceed
* immediatelly otherwise set timer
*/
- if (old_state == BTD_SERVICE_STATE_CONNECTING)
+ if (btd_service_is_initiator(service))
policy_connect(data, controller);
else if (btd_service_get_state(controller) !=
BTD_SERVICE_STATE_CONNECTED)
/* Check if service initiate the connection then proceed
* immediately otherwise set timer
*/
- if (old_state == BTD_SERVICE_STATE_CONNECTING)
+ if (btd_service_is_initiator(service))
policy_connect(data, sink);
else if (btd_service_get_state(sink) !=
BTD_SERVICE_STATE_CONNECTED)
/* Check if service initiate the connection then proceed
* immediatelly otherwise set timer
*/
- if (old_state == BTD_SERVICE_STATE_CONNECTING)
+ if (btd_service_is_initiator(service))
policy_connect(data, target);
else if (btd_service_get_state(target) !=
BTD_SERVICE_STATE_CONNECTED)