From: Archie Pusaka <apusaka@xxxxxxxxxxxx> When policy_connect() is called, there might be a case where the device is not ready, or even the adapter is down. Add some checks by calling btd_device_connect_services() instead of directly calling btd_service_connect(). --- Changes in v2: * Add adapter status check in btd_service_connect() instead of using btd_device_connect_services() src/service.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/service.c b/src/service.c index d810fc3b05..21a52762e6 100644 --- a/src/service.c +++ b/src/service.c @@ -229,6 +229,9 @@ int btd_service_connect(struct btd_service *service) if (!profile->connect) return -ENOTSUP; + if (!btd_adapter_get_powered(device_get_adapter(service->device))) + return -ENETDOWN; + switch (service->state) { case BTD_SERVICE_STATE_UNAVAILABLE: return -EINVAL; -- 2.29.1.341.ge80a0c044ae-goog