diff --git a/plugins/policy.c b/plugins/policy.c
index 0e533ba..561e3c0 100644
--- a/plugins/policy.c
+++ b/plugins/policy.c
timeout_remove(data->sink_timer);
data->sink_timer = 0;
}
+ data->sink_retries = 0;
/* Try connecting HSP/HFP if it is not connected */
hs = btd_device_get_service(dev, HFP_HS_UUID);
case BTD_SERVICE_STATE_CONNECTING:
break;
case BTD_SERVICE_STATE_CONNECTED:
+ if (data->hs_timer > 0) {
+ timeout_remove(data->hs_timer);
+ data->hs_timer = 0;
+ }
+ data->hs_retries = 0;
/* Check if service initiate the connection then proceed
* immediately otherwise set timer
*/
timeout_remove(data->source_timer);
data->source_timer = 0;
}
+ data->source_retries = 0;
/* Check if service initiate the connection then proceed
* immediatelly otherwise set timer
timeout_remove(data->ct_timer);
data->ct_timer = 0;
}
- } else if (old_state == BTD_SERVICE_STATE_CONNECTED) {
- data->ct_retries = 0;
}
break;
case BTD_SERVICE_STATE_CONNECTING:
timeout_remove(data->ct_timer);
data->ct_timer = 0;
}
+ data->ct_retries = 0;
break;
case BTD_SERVICE_STATE_DISCONNECTING:
break;
timeout_remove(data->tg_timer);
data->tg_timer = 0;
}
- } else if (old_state == BTD_SERVICE_STATE_CONNECTED) {
- data->tg_retries = 0;
}
break;
case BTD_SERVICE_STATE_CONNECTING:
timeout_remove(data->tg_timer);
data->tg_timer = 0;
}
+ data->tg_retries = 0;
break;
case BTD_SERVICE_STATE_DISCONNECTING:
break;