All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez PATCH v1 1/3] policy: add checks before connecting
@ 2020-11-04  5:35 Archie Pusaka
  2020-11-04  5:35 ` [Bluez PATCH v1 2/3] audio: unref session when failed to setup Archie Pusaka
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Archie Pusaka @ 2020-11-04  5:35 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz
  Cc: CrosBT Upstreaming, Archie Pusaka, Sonny Sasaka

From: Archie Pusaka <apusaka@chromium.org>

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().

Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
---

 plugins/policy.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/policy.c b/plugins/policy.c
index ba9e1be020..42b15cb65f 100644
--- a/plugins/policy.c
+++ b/plugins/policy.c
@@ -106,6 +106,7 @@ static void policy_connect(struct policy_data *data,
 {
 	struct btd_profile *profile = btd_service_get_profile(service);
 	struct reconnect_data *reconnect;
+	GSList *l = NULL;
 
 	reconnect = reconnect_find(btd_service_get_device(service));
 	if (reconnect && reconnect->active)
@@ -113,7 +114,9 @@ static void policy_connect(struct policy_data *data,
 
 	DBG("%s profile %s", device_get_path(data->dev), profile->name);
 
-	btd_service_connect(service);
+	l = g_slist_prepend(l, service);
+	btd_device_connect_services(data->dev, l);
+	g_slist_free(l);
 }
 
 static void policy_disconnect(struct policy_data *data,
-- 
2.29.1.341.ge80a0c044ae-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-05  4:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-04  5:35 [Bluez PATCH v1 1/3] policy: add checks before connecting Archie Pusaka
2020-11-04  5:35 ` [Bluez PATCH v1 2/3] audio: unref session when failed to setup Archie Pusaka
2020-11-04  5:35 ` [Bluez PATCH v1 3/3] audio/avdtp: Report failure in disconnected state Archie Pusaka
2020-11-04 19:22 ` [Bluez,v1,1/3] policy: add checks before connecting bluez.test.bot
2020-11-04 21:13 ` [Bluez PATCH v1 1/3] " Luiz Augusto von Dentz
2020-11-05  4:44   ` Archie Pusaka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.